Description
Discussed in #3803
Originally posted by clundstedt-m August 10, 2023
We are currently trying to run our tests in multiple browsers and eventually run those over our Lambdatest instance, nonetheless we haven't been able to even run them "locally" in multiple browsers nor the less at Lambdatest as when we try to run them using the run-workers |number| all
, we are getting the error that I wrote in the discussion title, so maybe (most likely) we are missing some pre-requisites to be fulfilled prior to be able to run the actual multiple feature?
The command that we are running is:
npx codeceptjs run-workers 3 all -c codecept.conf.POCCrossBrowser.ts --features --grep @CrossBrowserPOC
The specifics of the error are the following:
Could not load helper multiple from module './helper/multiple':
Cannot find module './helper/multiple'
Require stack:
- /Users/christian.lundstedt/tr-front-qa-automation/node_modules/codeceptjs/lib/container.js
- /Users/christian.lundstedt/tr-front-qa-automation/node_modules/codeceptjs/lib/codecept.js
- /Users/christian.lundstedt/tr-front-qa-automation/node_modules/codeceptjs/bin/codecept.js
Error: Cannot find module './helper/multiple'
Require stack:
- /Users/christian.lundstedt/tr-front-qa-automation/node_modules/codeceptjs/lib/container.js
- /Users/christian.lundstedt/tr-front-qa-automation/node_modules/codeceptjs/lib/codecept.js
- /Users/christian.lundstedt/tr-qa-automation/node_modules/codeceptjs/bin/codecept.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1070:15)
at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/Users/christian.lundstedt/tr-front-qa-automation/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
at Function.Module._load (node:internal/modules/cjs/loader:923:27)
at Module.require (node:internal/modules/cjs/loader:1137:19)
at require (node:internal/modules/helpers:121:18)
at createHelpers (/Users/christian.lundstedt/tr-front-qa-automation/node_modules/codeceptjs/lib/container.js:173:23)
at Function.create (/Users/christian.lundstedt/tr-front-qa-automation/node_modules/codeceptjs/lib/container.js:44:25)
at Codecept.init (/Users/christian.lundstedt/tr-front-qa-automation/node_modules/codeceptjs/lib/codecept.js:57:15)
at initializeCodecept (/Users/christian.lundstedt/tr-front-qa-automation/node_modules/codeceptjs/lib/workers.js:26:12)
at new Workers (/Users/christian.lundstedt/tr-front-qa-automation/node_modules/codeceptjs/lib/workers.js:214:21)
Our current .conf file looks like this (it includes the current capabilities for Lambdatest even if it doesn't/shouldn't really matter):
import * as dotenv from 'dotenv';
dotenv.config();
import { merge } from 'lodash';
import {defaultConfig} from '@forwardthinking/codeceptjs-helpers'
const webConfig = {
helpers: {
Playwright: {
url: 'https://demo.applitools.com/',
show: true,
waitForNavigation: 'networkidle',
desiredCapabilities: {}
},
multiple: {
profile1: {
browsers: [
{
browser: "chrome",
desiredCapabilties: {
'browserName': 'Chrome',
'browserVersion': '114.0',
'LT:Options': {
'platform': 'Windows 10',
'build': 'LT Poc with Playwright',
'name': 'Chrome - LT Test',
'user': process.env.LT_USERNAME,
'accessKey': process.env.LT_KEY,
}
}
},
{
browser: "firefox",
desiredCapabilties: {
'browserName': 'pw-firefox',
'browserVersion': 'latest',
'LT:Options': {
'platform': 'Windows 10',
'build': 'LT Poc with Playwright',
'name': 'Firefox - LT Test',
'user': process.env.LT_USERNAME,
'accessKey': process.env.LT_KEY,
}
}
},
]
},
profile2: {
browsers: [
{
browser: "safari",
desiredCapabilties: {
'browserName': 'pw-chromium',
'browserVersion': 'latest',
'LT:Options': {
'platform': 'MacOS Big sur',
'build': 'LT Poc with Playwright',
'name': 'Chromium MacOS - LT Test',
'user': process.env.LT_USERNAME,
'accessKey': process.env.LT_KEY,
}
}
}
]
},
//Helper API: Used to execute pre-conditions for specific API's
REST: {
endpoint: 'https://swapi.dev/api',
timeout: 10000
},
//recommended Helper to work with API with specific JSON responses
JSONResponse: {},
},
plugins: {
//disabled for POC purposes
cucumberJsonReporter: { enabled: false},
stats: { enabled: false },
},
}
}
const config = merge(defaultConfig,webConfig);
export {config}
Any guidance for this issue would be greatly appreciated as we cannot find any information or similar issues around the only and even have other people that got it to work without any hassle, like this one -- https://codecept.discourse.group/t/running-tests-across-multiple-browsers-in-playwright/761/2
Thanks in advance!