diff --git a/supporting_scripts/playwright/README.md b/supporting_scripts/playwright/README.md index 3358943720f6..9a1160755d08 100644 --- a/supporting_scripts/playwright/README.md +++ b/supporting_scripts/playwright/README.md @@ -16,10 +16,27 @@ In case you stop the client, you can simply re-run it at the root of the Artemis ## 2. Setup users Playwright needs users for it's tests. If you do not have users set up, you can simply do so by running: -`setupUsers.sh` + +```bash +setupUsers.sh +``` + This will create 20 test users. -## 3. Setup Playwright and run Playwright in UI-mode +## 3. Setup Playwright and run Playwright tests + +You can run Playwright tests in two different ways: running all tests or running in UI mode. + +### Running All Tests +The `startPlaywright.sh` script runs the full suite of Playwright tests in a headless mode, outputting the results to the command line. +- Executes all test cases defined in the Playwright test suite. +- Runs in a headless environment for faster execution. +- Outputs test results, including logs, in the terminal. + +### Running Tests in UI mode +The `startPlaywrightUI.sh` script starts Playwright in a graphical mode for debugging and interactive test execution. +- Launches a browser window to display available test cases. +- Allows manual selection and execution of individual or multiple tests. +- Provides real-time debugging features, such as visual test steps and screenshots. +- Useful for debugging and inspecting browser behavior during test execution. -Simply run: `startPlaywright.sh`. This will install the necessary dependencies for playwright and start it in UI mode. -If you already have playwright installed, you can also start playwright directly from the `src/test/playwright` directory with `npm run playwright:open`. diff --git a/supporting_scripts/playwright/runArtemisInDocker_linux.sh b/supporting_scripts/playwright/runArtemisInDocker_linux.sh index c979ea2d32b1..1bac4655fa2c 100755 --- a/supporting_scripts/playwright/runArtemisInDocker_linux.sh +++ b/supporting_scripts/playwright/runArtemisInDocker_linux.sh @@ -2,7 +2,7 @@ set -e -artemis_path="$(readlink -f "$(dirname $0)/../..")" +artemis_path="$(readlink -f "$(dirname "$0")/../..")" cd "$artemis_path/docker" diff --git a/supporting_scripts/playwright/runArtemisInDocker_macOS.sh b/supporting_scripts/playwright/runArtemisInDocker_macOS.sh index ab8dc424e740..9a084684d74c 100755 --- a/supporting_scripts/playwright/runArtemisInDocker_macOS.sh +++ b/supporting_scripts/playwright/runArtemisInDocker_macOS.sh @@ -2,7 +2,7 @@ set -e -artemis_path="$(readlink -f "$(dirname $0)/../..")" +artemis_path="$(readlink -f "$(dirname "$0")/../..")" cd "$artemis_path/docker" open -a Docker diff --git a/supporting_scripts/playwright/setupUsers.sh b/supporting_scripts/playwright/setupUsers.sh index cab70289a9d7..ea235692db48 100755 --- a/supporting_scripts/playwright/setupUsers.sh +++ b/supporting_scripts/playwright/setupUsers.sh @@ -3,7 +3,7 @@ # We use the supporting scripts to create users set -e -artemis_path="$(readlink -f "$(dirname $0)/../..")" +artemis_path="$(readlink -f "$(dirname "$0")/../..")" cd "$artemis_path/supporting_scripts" diff --git a/supporting_scripts/playwright/startPlaywright.sh b/supporting_scripts/playwright/startPlaywright.sh index 412b88919978..77d2832e585e 100755 --- a/supporting_scripts/playwright/startPlaywright.sh +++ b/supporting_scripts/playwright/startPlaywright.sh @@ -2,7 +2,7 @@ set -e -artemis_path="$(readlink -f "$(dirname $0)/../..")" +artemis_path="$(readlink -f "$(dirname "$0")/../..")" echo "Installing Playwright and dependencies" @@ -12,5 +12,5 @@ npm install npm run playwright:setup-local || true -echo "Starting Playwright in UI mode" -npm run playwright:open +echo "Run all playwright tests" +npm run playwright:test diff --git a/supporting_scripts/playwright/startPlaywrightUI.sh b/supporting_scripts/playwright/startPlaywrightUI.sh new file mode 100755 index 000000000000..0abe6e8bd2c6 --- /dev/null +++ b/supporting_scripts/playwright/startPlaywrightUI.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +artemis_path="$(readlink -f "$(dirname "$0")/../..")" + +echo "Installing Playwright and dependencies" + +cd "$artemis_path/src/test/playwright" + +npm install + +npm run playwright:setup-local || true + +echo "Start Playwright in UI mode" +npm run playwright:open