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
Copy file name to clipboardExpand all lines: README.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -125,31 +125,31 @@ npx playwright install
125
125
2. For execution entire test suite on all available browsers simultaneously execute below command where "ENV" can be "qa" or "dev", `Test Cases are present in "tests" folder`:
126
126
127
127
```JS
128
-
npx cross-env ENV=qa npm run test
128
+
npm run test--ENV="qa"
129
129
```
130
130
131
131
3. For executing single test case on Chrome browser execute the below command, you can change the browser for execution e.g. if you want to run test cases on Firefox, you can change `--project=Firefox` against `test:single` in `package.json`, just make sure the browser name given matches the name given in `playwright.config.ts`.
132
132
133
133
```JS
134
-
npx cross-env ENV=qa npm run test:single
134
+
npm run test:single--ENV="qa"
135
135
```
136
136
137
137
4. For executing test cases in parallel, provide a suitable tag `@SmokeTest` at the start of your test case name, then in `package.json` against `test:parallel` give the tag value and execute :
138
138
139
139
```JS
140
-
npx cross-env ENV=qa npm run test:parallel
140
+
npm run test:parallel--ENV="qa"
141
141
```
142
142
143
143
5. For executing test cases in sequence, provide a suitable tag `@SmokeTest` at the start of your test case name, then in `package.json` against `test:serial` give the tag value and execute, `workers` parameter correspond to test cases you want to execute simultaneously e.g. `--workers=3`, executes 3 test cases simultaneously :
144
144
145
145
```JS
146
-
npx cross-env ENV=qa npm run test:serial
146
+
npm run test:serial--ENV="qa"
147
147
```
148
148
149
149
6. For executing API test cases, please provide "ENV" value as "qaApi" or "devApi" :
150
150
151
151
```JS
152
-
npx cross-env ENV=qaApi npm run test:api
152
+
npm run test:api--ENV="qaApi"
153
153
```
154
154
155
155
7. For recording test scripts :
@@ -161,13 +161,13 @@ npm run test:record
161
161
8. To produce and visually compare screenshots execute below command. On first execution reference screenshot will be generated for comparision with subsequent runs.
162
162
163
163
```JS
164
-
npx cross-env ENV=qa npm run test:visual
164
+
npm run test:visual--ENV="qa"
165
165
```
166
166
167
167
9. For emulating test cases on any device, in `playwright.config.ts`, under device section provide desired device name and execute :
168
168
169
169
```JS
170
-
npx cross-env ENV=qa npm run test:device
170
+
npm run test:device--ENV="qa"
171
171
```
172
172
173
173
10. For Allure Report generation execute :
@@ -226,7 +226,7 @@ Once logger object is created you can use this instead of console.log in your fr
226
226
227
227
23. UI mode in Playwright is lets you explore, run and debug tests, it comes with a built-in watch mode. It opens like Traceviewer where you can use the window to find selectors, its directly integrated to VS Code, all the browsers definned in playwright config will be automatically picked up and you can chosse to run individual test cases in browser of choice and also we can run tests directly from UI mode instead of IDE. I have used the tag `@Smoke` in `test:ui` section of package.json, because all my UI test cases are tagged with `@Smoke` tag and we want to run only Web based test cases. To use UI mode use below command with `ENV` value of your choice
228
228
```JS
229
-
npx cross-env ENV=qa npm run test:ui
229
+
npm run test:ui--ENV="qa"
230
230
```
231
231
24. For Extracting text from PDF we are using `pdfjs-dist-es5` library. You can run the test case `PdfToText.test.ts` to verify contents of PDF file. `getPDFText()` method in `lib/WebActions.ts` class is used for extracting text from PDF file.
232
232
@@ -281,7 +281,7 @@ docker run --name playContainer playtest
281
281
- If you want to run a different test or provide custom command, Go to Dockerfile and edit the last line which is CMD section. The below sample runs test cases serially on QA environment.
282
282
Once you have edited the CMD section we have to follow Step 1 to build a new image and ten run the Container from that image.
0 commit comments