Skip to content

Commit

Permalink
refactor(Playwright): separate kernel dep from generic installation (f…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmadkashif authored Aug 21, 2023
1 parent 1c0b70d commit 9cdbd4f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions docs/how-to-add-playwright-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@

## Installation:

To install Playwright run:

```console
pnpm run playwright:install-build-tools
```

Alternatively you can follow official documentation referenced below:

To install and configure Playwright on your machine check out this [documentation](https://playwright.dev/docs/intro#installing-playwright)

To learn how to write Playwright tests, or 'specs', please see Playwright's official [documentation](https://playwright.dev/docs/writing-tests).


## Where to Add a Test

- Playwright tests are in the `./e2e` directory.
Expand All @@ -25,6 +34,11 @@ To learn how to write Playwright tests, or 'specs', please see Playwright's offi

To run tests with Playwright check the following below

- Make sure you navigate to the e2e repo first
```console
cd e2e
```

- To run tests in UI helper mode:

```console
Expand Down Expand Up @@ -93,6 +107,11 @@ npx playwright show-report

Playwright is generally a solid bullet-proof tool. The contributor has already configured the tests to run on all OS machines, including majpr distributions of Windows, MacOS and Linux.

- (MacOs and Linux) If running Playwright results in an error due to kernel dependencies, run the following command:

```console
pnpm run playwright:install-build-tools-linux
```

- A common error seen in playwright is as follows:

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"lint:prettier": "prettier --list-different .",
"reload:server": "pm2 reload api-server/ecosystem.config.js",
"preseed": "npm-run-all create:*",
"playwright:install-build-tools": "sh ./playwright-install.sh && cd ./e2e && npm i && npx playwright install && npx playwright install-deps",
"playwright:install-build-tools": "cd ./e2e && npm i && npx playwright install && npx playwright install-deps",
"playwright:install-build-tools-linux": "sh ./playwright-install.sh",
"seed": "cross-env DEBUG=fcc:* node ./tools/scripts/seed/seed-demo-user",
"seed:certified-user": "cross-env DEBUG=fcc:* node ./tools/scripts/seed/seed-demo-user certified-user",
"seed:exams": "cd tools/scripts/seed-exams && cross-env node ./create-exams.js",
Expand Down

0 comments on commit 9cdbd4f

Please sign in to comment.