You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide console output if related. Use --verbose mode for more details.
$ npm install
$ npx codeceptjs run
CodeceptJS v3.5.11 #StandWithUkraine
Using test root "/Users/takuyasuemura/ghq/github.com/tsuemura/codeceptjs-playwright-device-bug-reproduction"
Repro --
sessionScreen is {"width":1280,"height":720}
✖ Reproduce issue in 2433ms
-- FAILURES:
1) Repro
Reproduce issue:
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
assert(sessionScreen.width === 375)
+ expected - actual
-false
+true
Artifacts:
- screenshot: /Users/takuyasuemura/ghq/github.com/tsuemura/codeceptjs-playwright-device-bug-reproduction/output/Reproduce_issue.failed.png
FAIL | 0 passed, 1 failed // 3s
Run with --verbose flag to see complete NodeJS stacktrace
Provide test source code if related
Test code
constassert=require('assert/strict')Feature('Repro')Scenario('Reproduce issue',async({ I })=>{I.amOnPage('https://example.com')session('user1',async()=>{I.amOnPage('https://www.google.com')constsessionScreen=awaitI.executeScript(()=>{return{width: window.screen.width,height: window.screen.height};})console.log(`sessionScreen is ${JSON.stringify(sessionScreen)}`)// iPhone 6 is 375x667assert(sessionScreen.width===375)assert(sessionScreen.height===667)})})
Details
CodeceptJS version: "3.5.11"
NodeJS Version: v18.15.0
Operating System: MacOS Ventura 13.3.1
puppeteer || webdriverio || testcafe version (if related): Playwright 1.40.1
Configuration file:
codecept.conf.js
const{ setHeadlessWhen, setCommonPlugins }=require("@codeceptjs/configure");// turn on headless mode when running with HEADLESS=true environment variable// export HEADLESS=true && npx codeceptjs runsetHeadlessWhen(process.env.HEADLESS);// enable all common plugins https://github.com/codeceptjs/configure#setcommonpluginssetCommonPlugins();const{ devices }=require("playwright");/** @type {CodeceptJS.MainConfig} */exports.config={tests: "./*_test.js",output: "./output",helpers: {Playwright: {browser: "chromium",url: "http://localhost",show: true,emulate: devices["iPhone 6"],},},include: {I: "./steps_file.js",},name: "codeceptjs-playwright-device-bug-reproduction",};
The text was updated successfully, but these errors were encountered:
What are you trying to achieve?
If I open a new session during the session, Playwright does not respect the device emulation setting.
Here's the repository to reproduce the issue: https://github.com/tsuemura/codeceptjs-playwright-device-bug-reproduction
What do you get instead?
Test code
Details
codecept.conf.js
The text was updated successfully, but these errors were encountered: