How do I verify file download in automation tests with Mocha.js on LambdaTest cloud

How do I verify file download in automation tests with Mocha.js on LambdaTest cloud.

Hey Tim,

If you want to verify file download forMocha-js testing in automation test on LambdaTest, you can follow the below steps. You can refer to the sample test repo:

Step 1: Add test case

You can use the following test case (full test in single_test.js)

it("can find search results", function(done) {
    driver.get("https://lambdatest.github.io/sample-todo-app/").then(function() {
        driver.findElement(webdriver.By.xpath('/html/body/table/tbody/tr[]/td[2]/a')).click().then(function(){  
            if (driver.executeScript("lambda-file-exists=chromedriver_win32.zip")){
                driver.executeScript("lambda-status=passed");
            }
            else
            {
                driver.executeScript("lambda-status=failed");
            } 
        });
    });
  });

Here’s the GitHub repo for the same: https://github.com/rshmimondal/Mocha-js-verify-download