From c3ceef046145b322c6459e1c961b8fe1165b3ced Mon Sep 17 00:00:00 2001 From: bymyself Date: Sun, 22 Dec 2024 14:16:11 -0700 Subject: [PATCH] Update mobile settings visibility test (#2009) --- browser_tests/README.md | 2 ++ browser_tests/dialog.spec.ts | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/browser_tests/README.md b/browser_tests/README.md index b63db0ddb..e0ef99229 100644 --- a/browser_tests/README.md +++ b/browser_tests/README.md @@ -34,6 +34,8 @@ 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 diff --git a/browser_tests/dialog.spec.ts b/browser_tests/dialog.spec.ts index 28f101ede..0cff88ccb 100644 --- a/browser_tests/dialog.spec.ts +++ b/browser_tests/dialog.spec.ts @@ -77,8 +77,12 @@ test.describe('Missing models warning', () => { test.describe('Settings', () => { test('@mobile Should be visible on mobile', async ({ comfyPage }) => { await comfyPage.page.keyboard.press('Control+,') - const searchBox = comfyPage.page.locator('.settings-content') - await expect(searchBox).toBeVisible() + const settingsContent = comfyPage.page.locator('.settings-content') + await expect(settingsContent).toBeVisible() + const isUsableHeight = await settingsContent.evaluate( + (el) => el.clientHeight > 30 + ) + expect(isUsableHeight).toBeTruthy() }) test('Can open settings with hotkey', async ({ comfyPage }) => { @@ -94,7 +98,7 @@ test.describe('Settings', () => { test('Can change canvas zoom speed setting', async ({ comfyPage }) => { const maxSpeed = 2.5 await comfyPage.setSetting('Comfy.Graph.ZoomSpeed', maxSpeed) - test.step('Setting should persist', async () => { + await test.step('Setting should persist', async () => { expect(await comfyPage.getSetting('Comfy.Graph.ZoomSpeed')).toBe(maxSpeed) }) })