From 9cdbd4fc7bf7432d3485a18f9002c156462f695c Mon Sep 17 00:00:00 2001 From: Ahmad <57593864+Ahmadkashif@users.noreply.github.com> Date: Mon, 21 Aug 2023 15:41:40 +0500 Subject: [PATCH] refactor(Playwright): separate kernel dep from generic installation (#51277) --- docs/how-to-add-playwright-tests.md | 19 +++++++++++++++++++ package.json | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/how-to-add-playwright-tests.md b/docs/how-to-add-playwright-tests.md index 89946e65001..73d73f4af35 100644 --- a/docs/how-to-add-playwright-tests.md +++ b/docs/how-to-add-playwright-tests.md @@ -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. @@ -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 @@ -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: diff --git a/package.json b/package.json index 847017464d0..1be4cd7fb1e 100644 --- a/package.json +++ b/package.json @@ -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",