Skip to content

Commit b64be15

Browse files
committed
add: separate command for local test
1 parent 9830f9b commit b64be15

File tree

5 files changed

+35
-2
lines changed

5 files changed

+35
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This repo contains samples for running [Playwright](https://playwright.dev/docs/
1212
## Running your tests
1313

1414
- To run the sample tests in parallel across the platforms specified in the `browserstack.yml`, run `npm run sample-test`.
15+
- To run the sample local tests in parallel across the platforms specified in the `browserstack.yml`, run `npm run sample-local-test`.
1516

1617
## Notes
1718
* You can view your test results on the [BrowserStack Automate dashboard](https://www.browserstack.com/automate)

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"sample-test": "npx browserstack-node-sdk playwright test --config=./playwright.config.js"
7+
"sample-test": "npx browserstack-node-sdk playwright test --config=./playwright.config.js",
8+
"sample-local-test": "npx browserstack-node-sdk playwright test --config=./playwright.local.config.js"
89
},
910
"keywords": [],
1011
"author": "",

playwright.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This is a sample config for what users might be running locally
22
const config = {
33
testDir: './tests',
4-
testMatch: '**/*.js',
4+
testMatch: '**/bstack_test*.js',
55

66
/* Maximum time one test can run for. */
77
timeout: 90 * 1000,

playwright.local.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// This is a sample config for what users might be running locally
2+
const config = {
3+
testDir: './tests',
4+
testMatch: '**/bstack_local*.js',
5+
6+
/* Maximum time one test can run for. */
7+
timeout: 90 * 1000,
8+
expect: {
9+
/**
10+
* Maximum time expect() should wait for the condition to be met.
11+
* For example in `await expect(locator).toHaveText();`
12+
*/
13+
timeout: 5000,
14+
},
15+
/* tests in parallel */
16+
workers: 1,
17+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
18+
reporter: 'line',
19+
/* Configure projects for major browsers */
20+
projects: [
21+
{
22+
name: 'chrome',
23+
use: {
24+
browserName: 'chromium',
25+
channel: 'chrome',
26+
},
27+
},
28+
],
29+
};
30+
31+
module.exports = config;
File renamed without changes.

0 commit comments

Comments
 (0)