-
Notifications
You must be signed in to change notification settings - Fork 3
Wait for LiveView readiness in deployed browser checks #1661
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9b48a1b
Wait for LiveView hydration in deployed browser checks
jhgaylor 0e8e253
Wait for the catalog-required browser provider selector
jhgaylor a712cb2
Merge branch 'main' into codex/conformance-qualification
jhgaylor 8738bba
Merge branch 'main' into codex/conformance-qualification
jhgaylor 492c8e7
Require an explicit provider selection to persist in the console check
jhgaylor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // Server-rendered controls can be visible before LiveView installs its event | ||
| // handlers. Wait for the connection before filling or submitting those forms; | ||
| // Playwright's visibility/actionability checks do not establish hydration. | ||
| export async function waitForLiveView(page) { | ||
| await page.locator('[data-phx-main].phx-connected').waitFor({ state: 'attached' }); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import test from 'node:test'; | ||
| import assert from 'node:assert/strict'; | ||
| import { selectBrowserProvider, verifyBrowserProvider } from '../profiles/browser-console.mjs'; | ||
|
|
||
| const pinned = 'sprites'; | ||
|
|
||
| // Drives the console create-agent provider steps against a fake selector: | ||
| // `visible` is whether the form currently renders the provider select, | ||
| // `stored` is what the public API reads back for the saved agent. | ||
| async function createAgent({ enabled, visible, stored, defaultProvider = pinned }) { | ||
| const selections = []; | ||
| const provider = { async count() { return visible ? 1 : 0; }, async selectOption(value) { selections.push(value); } }; | ||
| const catalog = { data: { sandbox_providers: { enabled, default: defaultProvider } } }; | ||
| const selected = await selectBrowserProvider(provider, catalog, pinned); | ||
| const agent = { sandbox_provider: stored }; | ||
| verifyBrowserProvider(agent, catalog, pinned, selected); | ||
| return { selections, agent }; | ||
| } | ||
|
|
||
| test('multiple providers require the explicit selection to persist even when it equals the default', async () => { | ||
| const scenario = { enabled: ['sprites', 'runner'], visible: true }; | ||
| await assert.rejects(createAgent({ ...scenario, stored: null }), /UI agent sandbox provider did not persist/); | ||
| const result = await createAgent({ ...scenario, stored: 'sprites' }); | ||
| assert.deepEqual(result.selections, ['sprites']); | ||
| assert.equal(result.agent.sandbox_provider, 'sprites'); | ||
| }); | ||
|
|
||
| test('a visible sole-provider selector also requires explicit persistence', async () => { | ||
| await assert.rejects(createAgent({ enabled: ['sprites'], visible: true, stored: null }), /UI agent sandbox provider did not persist/); | ||
| }); | ||
|
|
||
| test('a hidden sole-provider selector permits the effective instance default', async () => { | ||
| const scenario = { enabled: ['sprites'], visible: false, stored: null }; | ||
| const result = await createAgent(scenario); | ||
| assert.deepEqual(result.selections, []); | ||
| assert.equal(result.agent.sandbox_provider, null); | ||
| await assert.rejects(createAgent({ ...scenario, defaultProvider: 'runner' }), /UI agent sandbox provider did not persist/); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.