Skip to content
\n

Our current .conf file looks like this (it includes the current capabilities for Lambdatest even if it doesn't/shouldn't really matter):

\n
import * as dotenv from 'dotenv';\ndotenv.config();\nimport { merge } from 'lodash';\nimport {defaultConfig} from '@forwardthinking/codeceptjs-helpers'\n\n\nconst webConfig = {\n  helpers: {\n    Playwright: {\n      url: 'https://demo.applitools.com/',\n      show: true,\n      waitForNavigation: 'networkidle',\n      desiredCapabilities: {}\n    },\n    multiple: {\n      profile1: {\n        browsers: [\n          {\n            browser: \"chrome\",\n            desiredCapabilties: {\n              'browserName': 'Chrome',\n              'browserVersion': '114.0',\n              'LT:Options': {\n                  'platform': 'Windows 10',\n                  'build': 'LT Poc with Playwright',\n                  'name': 'Chrome - LT Test',\n                  'user': process.env.LT_USERNAME,\n                  'accessKey': process.env.LT_KEY,\n              }\n            }\n          },\n          {\n            browser: \"firefox\",\n            desiredCapabilties: {\n              'browserName': 'pw-firefox',\n              'browserVersion': 'latest',\n              'LT:Options': {\n                  'platform': 'Windows 10',\n                  'build': 'LT Poc with Playwright',\n                  'name': 'Firefox - LT Test',\n                  'user': process.env.LT_USERNAME,\n                  'accessKey': process.env.LT_KEY,\n            }\n          }\n          },\n        ]\n      },\n      profile2: {\n        browsers: [\n          {\n            browser: \"safari\",\n            desiredCapabilties: {\n              'browserName': 'pw-chromium',\n              'browserVersion': 'latest',\n              'LT:Options': {\n                  'platform': 'MacOS Big sur',\n                  'build': 'LT Poc with Playwright',\n                  'name': 'Chromium MacOS - LT Test',\n                  'user': process.env.LT_USERNAME,\n                  'accessKey': process.env.LT_KEY,\n            }\n            }\n          }\n        ]\n      }, \n    //Helper API: Used to execute pre-conditions for specific API's\n    REST: {\n      endpoint: 'https://swapi.dev/api',\n      timeout: 10000\n    },\n    //recommended Helper to work with API with specific JSON responses\n    JSONResponse: {},\n  },\n\n  plugins: {\n  //disabled for POC purposes\n    cucumberJsonReporter: { enabled: false},\n    stats: { enabled: false },\n  },\n}\n}\n\nconst config = merge(defaultConfig,webConfig);\nexport {config}
\n

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

\n

Thanks in advance!

","upvoteCount":3,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"
  helpers: {\n    Playwright: {\n      url: 'https://github.com',\n      show: false,\n      browser: 'chromium',\n      waitForNavigation: 'load',\n      waitForTimeout: 30_000,\n      trace: true,\n      keepTraceForPassedTests: true\n    },\n    CDPHelper: {\n      require: './helpers/CDPHelper.ts'\n    },\n    OpenAI: {\n      chunkSize: 8000\n    },\n    ExpectHelper: {\n      require: \"codeceptjs-expect\"\n    },\n    REST: {\n      endpoint: 'https://reqres.in',\n      timeout: 20_000\n    },\n    AllureHelper: {\n      require: './helpers/AllureHelper.ts'\n    }\n  },\n  multiple: {\n    profile1: {\n      browsers: [\n        {\n          browser: \"chromium\",\n        }\n      ]\n    },\n  },\n
\n

I could not trigger trigger with all but profile1 works for me.

\n
➜  codeceptjs-playwright-fun git:(main) ✗ npx codeceptjs run-workers 3 profile1 -c codecept.conf.ts\nCodeceptJS v3.5.3 #StandWithUkraine\nRunning tests in 3 workers...\n\n[02]   ✔ Normal network in 1310ms\n[01]   ✔ Incorrect username or password. in 1463ms\n[03]   ✔ Web Socket in 3475ms\n\n  OK  | 3 passed, 3 skipped   // 6s\n
","upvoteCount":0,"url":"https://github.com/codeceptjs/CodeceptJS/discussions/3803#discussioncomment-6702661"}}}

CodeceptJS + Playwright Error: Cannot find module './helper/multiple' #3803

Closed Answered by kobenguyent
clundstedt-m asked this question in Q&A
Discussion options

You must be logged in to vote
  helpers: {
    Playwright: {
      url: 'https://github.com',
      show: false,
      browser: 'chromium',
      waitForNavigation: 'load',
      waitForTimeout: 30_000,
      trace: true,
      keepTraceForPassedTests: true
    },
    CDPHelper: {
      require: './helpers/CDPHelper.ts'
    },
    OpenAI: {
      chunkSize: 8000
    },
    ExpectHelper: {
      require: "codeceptjs-expect"
    },
    REST: {
      endpoint: 'https://reqres.in',
      timeout: 20_000
    },
    AllureHelper: {
      require: './helpers/AllureHelper.ts'
    }
  },
  multiple: {
    profile1: {
      browsers: [
        {
          browser: "chromium",
        }
      ]
    },
  },

I could not trigger t…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@clundstedt-m
Comment options

@kobenguyent
Comment options

@clundstedt-m
Comment options

@kobenguyent
Comment options

Answer selected by clundstedt-m
@clundstedt-m
Comment options

@kobenguyent
Comment options

@clundstedt-m
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants