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: tests/tests_e2e/playwright/README.md
+43-20Lines changed: 43 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,48 +33,57 @@ tests
33
33
-`handlers.py`: Contains classes fore handling the different level of access to
34
34
services a User might encounter, such as Notebook, Conda-store and others.
35
35
36
-
## Setup
37
-
38
-
1.**Install Nebari with Development Requirements**
36
+
Below is an example of how you might update the **Setup** and **Running the Playwright Tests** sections of your README to reflect the new `Makefile` and the updated `pytest` invocation.
39
37
40
-
Install Nebari including development requirements (which include Playwright):
38
+
---
41
39
42
-
```bash
43
-
pip install -e ".[dev]"
44
-
```
40
+
## Setup
45
41
46
-
2.**Install Playwright**
42
+
1.**Use the provided Makefile to install dependencies**
47
43
48
-
Install Playwright:
44
+
Navigate to the Playwright tests directory and run the `setup` target:
49
45
50
46
```bash
51
-
playwright install
47
+
cd tests_e2e/playwright
48
+
make setup
52
49
```
53
50
54
-
*Note:* If you see the warning `BEWARE: your OS is not officially supported by Playwright; downloading fallback build`, it is not critical. Playwright should still work (see microsoft/playwright#15124).
51
+
This command will:
55
52
56
-
3.**Create Environment Vars**
53
+
- Install the pinned dependencies from `requirements.txt`.
54
+
- Install Playwright and its required browser dependencies.
55
+
- Create a new `.env` file from `.env.tpl`.
57
56
58
-
Fill in your execution space environment with the following values:
57
+
2.**Fill in the `.env` file**
59
58
60
-
-`KEYCLOAK_USERNAME`: Nebari username for username/password login or Google email address/Google sign-in.
61
-
-`KEYCLOAK_PASSWORD`: Password associated with `KEYCLOAK_USERNAME`.
62
-
-`NEBARI_FULL_URL`: Full URL path including scheme to the Nebari instance (e.g., "https://nebari.quansight.dev/").
59
+
Open the newly created `.env` file and fill in the following values:
63
60
64
-
This user can be created with the following command (or use an existing non-root user):
61
+
-`KEYCLOAK_USERNAME`: Nebari username for username/password login (or Google email for Google sign-in).
62
+
-`KEYCLOAK_PASSWORD`: Password associated with the above username.
63
+
-`NEBARI_FULL_URL`: Full URL (including `https://`) to the Nebari instance (e.g., `https://nebari.quansight.dev/`).
64
+
65
+
If you need to create a user for testing, you can do so with:
BEWARE: your OS is not officially supported by Playwright; downloading fallback build
74
+
```
75
+
it is not critical. Playwright should still work despite the warning.
71
76
72
-
Playwright tests are run inside of pytest using:
77
+
## Running the Playwright Tests
73
78
79
+
You can run the Playwright tests with `pytest`.
74
80
```bash
75
-
pytest tests_e2e/playwright/test_playwright.py
81
+
pytest tests_e2e/playwright/test_playwright.py --numprocesses auto
76
82
```
77
83
84
+
> **Important**: Due to how Pytest manages async code; Playwright’s sync calls can conflict with default Pytest concurrency settings, and using `--numprocesses auto` helps mitigate potential thread-blocking issues.
85
+
86
+
78
87
Videos of the test playback will be available in `$PWD/videos/`. To disabled the browser
79
88
runtime preview of what is happening while the test runs, pass the `--headed` option to `pytest`. You
80
89
can also add the `--slowmo=$MILLI_SECONDS` option to introduce a delay before each
@@ -188,3 +197,17 @@ If your test suit presents a need for a more complex sequence of actions or spec
188
197
parsing around the contents present in each page, you can create
189
198
your own handler to execute the auxiliary actions while the test is running. Check the
190
199
`handlers.py` over some examples of how that's being done.
200
+
201
+
202
+
## Debugging Playwright tests
203
+
204
+
Playwright supports a debug mode called
205
+
[Inspector](https://playwright.dev/python/docs/debug#playwright-inspector) that can be
206
+
used to inspect the browser and the page while the test is running. To enabled this
207
+
debugging option within the tests execution you can pass the `PWDEBUG=1` variable within
208
+
your test execution command.
209
+
210
+
For example, to run a single test with the debug mode enabled, you can use the following
0 commit comments