From a2b3048b9416c6db00fff4651597c27b757989bd Mon Sep 17 00:00:00 2001 From: Benjamin Lu Date: Sun, 6 Apr 2025 21:00:14 -0400 Subject: [PATCH] Clarify Playwright setup README and add note to .env_example (#3336) Co-authored-by: Benjamin Lu --- .env_example | 1 + browser_tests/README.md | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.env_example b/.env_example index 3caafb483..07eda86be 100644 --- a/.env_example +++ b/.env_example @@ -1,4 +1,5 @@ # Local development playwright target +# Note: Don't add a trailing / after the port PLAYWRIGHT_TEST_URL=http://localhost:5173 # PLAYWRIGHT_TEST_URL=http://localhost:8188 diff --git a/browser_tests/README.md b/browser_tests/README.md index e0ef99229..307a4e527 100644 --- a/browser_tests/README.md +++ b/browser_tests/README.md @@ -9,15 +9,26 @@ If `TEST_COMFYUI_DIR` in `.env` isn't set to your `(Comfy Path)/ComfyUI` directo ## Setup -Clone to your `custom_nodes` directory. -ComfyUI_devtools adds additional API endpoints and nodes to ComfyUI for browser testing. +### ComfyUI devtools +Clone to your `custom_nodes` directory. +_ComfyUI_devtools adds additional API endpoints and nodes to ComfyUI for browser testing._ +### Node.js & Playwright Prerequisites Ensure you have Node.js v20 or later installed. Then, set up the Chromium test driver: - ```bash npx playwright install chromium --with-deps ``` +### Environment Variables +Ensure the environment variables in `.env` are set correctly according to your setup. + +The `.env` file will not exist until you create it yourself. + +A template with helpful information can be found in `.env_example`. + +### Multiple Tests +If you are running Playwright tests in parallel or running the same test multiple times, the flag `--multi-user` must be added to the main ComfyUI process. + ## Running Tests There are two ways to run the tests: @@ -34,8 +45,6 @@ There are two ways to run the tests: ``` This opens a user interface where you can select specific tests to run and inspect the test execution timeline. - To run the same test multiple times in Playwright's UI mode, you must launch the main ComfyUI process with the `--multi-user` flag. - ![Playwright UI Mode](https://github.com/user-attachments/assets/6a1ebef0-90eb-4157-8694-f5ee94d03755) ## Screenshot Expectations