How do I run tests on multiple browsers in LambdaTest?

I have a LambdaTest and TestCafe setup, LambdaTest account has a single parallel run. As far as I understand, TestCafe doesn’t support queuing of tests. So my question is how do I manage to run tests on different browser/OS combination on LambdaTest(one after the other without queuing).

Thanks in advance.

1 Like

Here is an example code to run parallel testing over LambdaTest Selenium Grid through custom TestCafe runner.

const browsers = [
  ['lambdatest:Chrome@74.0:Windows 10"', 'lambdatest:Chrome@75.0:Windows 10'],
  ['lambdatest:Chrome@76.0:Windows 8', 'lambdatest:Chrome@77.0:Windows 8'],
];
const runTest = async browser => {
  console.log('starting tests');
  await createTestCafe('localhost', 1337, 1338)
    .then(tc => {
      testcafe = tc;
      const runner = testcafe.createRunner();
      return runner
        .src(['web-tests/*.ts'])
        .browsers(browser)
        .run();
    })
    .then(async failedCount => {
      console.log('Tests failed: ' + failedCount);
      await testcafe.close();
      return;
    });
}
const runAllBrowsers = async () => {
  for (const browser of browsers) {
    await runTest(browser);
  }
}
2 Likes