Skip to content

Commit 074f770

Browse files
committed
test: add playwright mobile config
1 parent 70d3594 commit 074f770

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,15 @@
3737
"start": "node scripts/start.js",
3838
"build": "node scripts/build.js",
3939
"lint": "eslint --color src",
40-
"test:playwright-local": "playwright test --config=./playwright-local/playwright-local.config.js --project=chromium",
41-
"test:playwright-local--h": "playwright test --config=./playwright-local/playwright-local.config.js --project=chromium --headed",
40+
"test:playwright-local:local": "playwright test --config=./playwright-local/playwright-local.config.js",
41+
"test:playwright-local:local:chromium": "playwright test --config=./playwright-local/playwright-local.config.js --project=chromium",
42+
"test:playwright-local:local:chromium--h": "playwright test --config=./playwright-local/playwright-local.config.js --project=chromium --headed",
43+
"test:playwright-local:local:mobile": "playwright test --config=./playwright-local/playwright-local.config.js --project=mobile-safari",
44+
"test:playwright-local:local:mobile--h": "playwright test --config=./playwright-local/playwright-local.config.js --project=mobile-safari --headed",
4245
"test:playwright-local:ci": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:playwright-local",
43-
"test:playwright-local:local": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:playwright-local",
46+
"test:playwright-local:ci:chromium": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:playwright-local:local:chromium",
47+
"test:playwright-local:ci:mobile": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:playwright-local:local:mobile",
48+
"test:playwright-local:local:chrome:mobile": "export NODE_ENV=development; start-server-and-test start http://localhost:3000 test:playwright-local:local",
4449
"snyk-protect": "snyk-protect",
4550
"prepublish": "yarn snyk-protect"
4651
},

playwright-local/playwright-local.config.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,21 @@ module.exports = defineConfig({
3434
projects: [
3535
{
3636
name: 'chromium',
37-
use: { ...devices['Desktop Chrome'] },
37+
use: {
38+
...devices['Desktop Chrome'],
39+
viewport: {
40+
width: 1300,
41+
height: 1000
42+
}
43+
}
3844
},
45+
{
46+
name: 'mobile-safari',
47+
testIgnore: ['tests/prize/**'],
48+
use: { ...devices['iPhone 12'] },
49+
timeout: 360_000,
50+
expect: { timeout: 20_000 }
51+
}
3952
],
4053

4154
/* Run your local dev server before starting the tests */

0 commit comments

Comments
 (0)