Repository navigation
test: cover QA Desk C-03 tab order across two reloads #22751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| import type { WebSocketRoute } from '@playwright/test' | ||
|
|
||
| import { | ||
| comfyPageFixture as test, | ||
| comfyExpect as expect | ||
| } from '@e2e/fixtures/ComfyPage' | ||
|
|
||
| test.describe('Workflow tab order', { tag: ['@ui'] }, () => { | ||
| test.beforeEach(async ({ comfyPage }) => { | ||
| await comfyPage.workflow.setupWorkflowsDirectory({}) | ||
| }) | ||
|
|
||
| test.afterEach(async ({ comfyPage }) => { | ||
| await comfyPage.workflow.setupWorkflowsDirectory({}) | ||
| }) | ||
|
|
||
| test('restores the latest tab order and active tab across two reloads', async ({ | ||
| comfyPage | ||
| }) => { | ||
| test.info().annotations.push({ | ||
| type: 'qa-case', | ||
| description: | ||
| 'QA Desk 1.60 C-03 (retest of 1.59 C-09): tabs restore the latest order' | ||
| }) | ||
| const { page } = comfyPage | ||
| const { topbar } = comfyPage.menu | ||
| const activeTab = (name: string) => | ||
| topbar.getWorkflowTab(name).and(topbar.getActiveTab()) | ||
| const nextClientIds: string[] = [] | ||
| await page.routeWebSocket(/\/ws(\?|$)/, (socket: WebSocketRoute) => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| const sid = nextClientIds.shift() | ||
| if (!sid) return | ||
| socket.send( | ||
| JSON.stringify({ | ||
| type: 'status', | ||
| data: { status: { exec_info: { queue_remaining: 0 } }, sid } | ||
| }) | ||
| ) | ||
| }) | ||
| const reloadWithNewClientIdLikeCloud = async (sid: string) => { | ||
| nextClientIds.push(sid) | ||
| await comfyPage.workflow.reloadAndWaitForApp() | ||
| await expect | ||
| .poll( | ||
| () => page.evaluate(() => window.app!.api.clientId), | ||
| 'Cloud hands every page load a new client id' | ||
| ) | ||
| .toBe(sid) | ||
| } | ||
|
|
||
| await test.step('open five saved workflows', async () => { | ||
| await topbar.saveWorkflowAs('tab-a') | ||
| for (const name of ['tab-b', 'tab-c', 'tab-d', 'tab-e']) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| await topbar.newWorkflowButton.click() | ||
| await topbar.saveWorkflowAs(name) | ||
| } | ||
| await expect | ||
| .poll(() => topbar.getTabNames()) | ||
| .toEqual(['tab-a', 'tab-b', 'tab-c', 'tab-d', 'tab-e']) | ||
| await expect(activeTab('tab-e')).toBeVisible() | ||
| }) | ||
|
|
||
| await test.step('drag the last tab to the front', async () => { | ||
| await topbar | ||
| .getWorkflowTab('tab-e') | ||
| .dragTo(topbar.getWorkflowTab('tab-a')) | ||
| await expect | ||
| .poll(() => topbar.getTabNames()) | ||
| .toEqual(['tab-e', 'tab-a', 'tab-b', 'tab-c', 'tab-d']) | ||
| }) | ||
|
|
||
| await test.step('close the tabs to the right of the second tab', async () => { | ||
| await topbar.getWorkflowTab('tab-a').click({ button: 'right' }) | ||
| await comfyPage.contextMenu.clickMenuItem('Close Tabs to Right') | ||
| await expect.poll(() => topbar.getTabNames()).toEqual(['tab-e', 'tab-a']) | ||
| await expect(activeTab('tab-e')).toBeVisible() | ||
| }) | ||
|
|
||
| await test.step('the first reload restores the same tabs', async () => { | ||
| await reloadWithNewClientIdLikeCloud('cloud-load-1') | ||
| await expect.poll(() => topbar.getTabNames()).toEqual(['tab-e', 'tab-a']) | ||
| await expect(activeTab('tab-e')).toBeVisible() | ||
| }) | ||
|
|
||
| await test.step('reorder the tabs again', async () => { | ||
| await topbar | ||
| .getWorkflowTab('tab-a') | ||
| .dragTo(topbar.getWorkflowTab('tab-e')) | ||
| await expect.poll(() => topbar.getTabNames()).toEqual(['tab-a', 'tab-e']) | ||
| await expect(activeTab('tab-a')).toBeVisible() | ||
| }) | ||
|
|
||
| await test.step('the second reload restores the latest order', async () => { | ||
| await reloadWithNewClientIdLikeCloud('cloud-load-2') | ||
| await expect.poll(() => topbar.getTabNames()).toEqual(['tab-a', 'tab-e']) | ||
| await expect(activeTab('tab-a')).toBeVisible() | ||
| }) | ||
| }) | ||
| }) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: Comfy-Org/ComfyUI_frontend
Length of output: 27279
Move this new spec into a feature folder.
This spec is directly under
browser_tests/tests/, but new specs must be placed in a folder that mirrors the feature under test. Move it into the matching workflow-tabs feature folder.