Repository navigation
test(cloud): pin remote widget web-session workspace #19484
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
Changes from all commits
af04263
9141ee3
d1be2e3
a451b84
2e8c61e
afeb934
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,68 @@ | ||||||
| import { expect } from '@playwright/test' | ||||||
|
|
||||||
| import { webSessionTest } from '@e2e/fixtures/webSessionFixture' | ||||||
| import { jsonRoute } from '@e2e/fixtures/utils/jsonRoute' | ||||||
|
|
||||||
| const TEAM_WORKSPACE_ID = 'ws-team' | ||||||
| const TEAM_OPTIONS = ['team-checkpoint.safetensors'] | ||||||
| const PERSONAL_OPTIONS = ['personal-checkpoint.safetensors'] | ||||||
|
|
||||||
| const test = webSessionTest.extend({ | ||||||
| page: async ({ page }, use) => { | ||||||
| await page.route('**/api/settings', (route) => route.fulfill(jsonRoute({}))) | ||||||
|
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. 🟢 Low — Fulfilling |
||||||
| await page.route('**/api/userdata**', (route) => | ||||||
|
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. 🟢 Low — |
||||||
| route.fulfill(jsonRoute([])) | ||||||
| ) | ||||||
| await use(page) | ||||||
| } | ||||||
| }) | ||||||
|
Comment on lines
+10
to
+18
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. Note to self: Another routing fixture to add to the standardization work. |
||||||
|
|
||||||
| test.describe( | ||||||
| 'Remote widget web-session routing', | ||||||
| { tag: ['@cloud', '@widget'] }, | ||||||
|
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. Or does
Suggested change
|
||||||
| () => { | ||||||
| test.describe.configure({ timeout: 120_000 }) | ||||||
|
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. These can't all actually need this long a timeout. |
||||||
|
|
||||||
| test.use({ | ||||||
| initialLocalStorage: { | ||||||
| 'Comfy.Workspace.LastWorkspaceId': TEAM_WORKSPACE_ID | ||||||
| } | ||||||
| }) | ||||||
|
|
||||||
| test('shows options from the selected team workspace', async ({ | ||||||
|
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. 🟢 Low — The suite is named for workspace routing but contains a single positive load and never switches workspaces, so the |
||||||
| comfyPage | ||||||
| }) => { | ||||||
| await comfyPage.page.route( | ||||||
| '**/api/models/checkpoints**', | ||||||
| async (route) => { | ||||||
| const workspaceId = await route | ||||||
| .request() | ||||||
| .headerValue('x-comfy-workspace-id') | ||||||
| await route.fulfill( | ||||||
| jsonRoute( | ||||||
| workspaceId === TEAM_WORKSPACE_ID | ||||||
| ? TEAM_OPTIONS | ||||||
| : PERSONAL_OPTIONS | ||||||
| ) | ||||||
| ) | ||||||
| } | ||||||
| ) | ||||||
|
Comment on lines
+35
to
+49
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. Normally I would expect a matching route promise binding and a subsequent await. |
||||||
|
|
||||||
| await comfyPage.workflow.loadWorkflow('inputs/remote_widget') | ||||||
|
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. 🟢 Low — The workflow is loaded without first waiting for the web session and workspace scope to be established. |
||||||
|
|
||||||
| await expect | ||||||
|
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. 🟡 Medium — |
||||||
| .poll(() => | ||||||
| comfyPage.page.evaluate(() => { | ||||||
| const node = window.app!.graph.nodes.find( | ||||||
| ({ title }) => title === 'Remote Widget Node' | ||||||
| ) | ||||||
|
Comment on lines
+56
to
+58
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. Don't we have a utility for this that we could use? |
||||||
| return { | ||||||
| options: node?.widgets?.[0].options.values, | ||||||
|
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. 🟡 Medium — |
||||||
| value: node?.widgets?.[0].value | ||||||
| } | ||||||
| }) | ||||||
| ) | ||||||
| .toEqual({ options: TEAM_OPTIONS, value: TEAM_OPTIONS[0] }) | ||||||
| }) | ||||||
| } | ||||||
| ) | ||||||
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.
Is there a more specific domain we can use for placing this test?