Skip to content

Commit db2e2ec

Browse files
Pratik Thakurfrancisf
authored andcommitted
updated local setup
1 parent 128f2bb commit db2e2ec

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@
1212

1313
## Running your tests
1414

15-
- To run your first test, run `npx playwright test`
15+
- To run a sample test, run `npm run sample-test`
1616

1717
## Run tests on locally hosted websites
18-
* Set `browserstack.local:true` in `browserstack.config.js`
19-
* uncomment line 22,23,24 where we are triggring BrowserStackLocal language binding
20-
* Add test file inside tests directory
21-
* Run `npx playwright test`
18+
* Run `npm run sample-local-test`
2219

2320
Understand how many parallel sessions you need by using our [Parallel Test Calculator](https://www.browserstack.com/automate/parallel-calculator?ref=github)
2421

browserstack.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ const caps = {
1616
os_version: 'catalina',
1717
name: 'My first playwright test',
1818
build: 'playwright-build',
19-
'browserstack.username': process.env.BROWSERSTACK_USERNAME || 'userName',
20-
'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY || 'accesskey',
21-
'browserstack.local': process.env.BROWSERSTACK_LOCAL || false,
19+
'browserstack.username': process.env.BROWSERSTACK_USERNAME || 'USERNAME',
20+
'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY || 'ACCESSKEY',
21+
'browserstack.local': process.env.BROWSERSTACK_LOCAL || true,
2222
'client.playwrightVersion': clientPlaywrightVersion,
2323
};
2424

2525
exports.bsLocal = new BrowserStackLocal.Local();
2626

2727
// replace YOUR_ACCESS_KEY with your key. You can also set an environment variable - "BROWSERSTACK_ACCESS_KEY".
2828
exports.BS_LOCAL_ARGS = {
29-
key: process.env.BROWSERSTACK_ACCESS_KEY || 'accesskey',
29+
key: process.env.BROWSERSTACK_ACCESS_KEY || 'ACCESSKEY',
3030
};
3131

3232
// Patching the capabilities dynamically according to the project name.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
"version": "1.0.0",
44
"description": "",
55
"main": "index.js",
6-
"scripts": {},
6+
"scripts": {
7+
"sample-local-test":"npx playwright test tests/local_test.js",
8+
"sample-test":"npx playwright test tests/sample_test.js"
9+
},
710
"keywords": [],
811
"author": "",
912
"license": "ISC",

playwright.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ const { getCdpEndpoint } = require('./browserstack.config.js')
1414
* @type {import('@playwright/test').PlaywrightTestConfig}
1515
*/
1616
const config = {
17-
testDir: './tests',
18-
testMatch: 'sample_test.js',
19-
// testMatch: '**/*.js', -- to run all the test in test directory
17+
// testDir: './tests',
18+
testMatch: '**/*.js',
2019

21-
// uncomment below 3 lines for local testing
20+
// testMatch: 'sample_test.js',
2221
// testMatch: 'local_test.js',
23-
// globalSetup: require.resolve('./global-setup'),
24-
// globalTeardown: require.resolve('./global-teardown'),
22+
23+
globalSetup: require.resolve('./global-setup'),
24+
globalTeardown: require.resolve('./global-teardown'),
2525

2626
/* Maximum time one test can run for. */
2727
timeout: 90 * 1000,

0 commit comments

Comments
 (0)