Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions playwright/diagnostics.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,11 @@ test('component lint reports missing button type prop', async ({ page }) => {

await runComponentLint(page)

await waitForLintDiagnosticsIssues(page)
await waitForLintDiagnosticsIssues(page, {
rerunLint: async () => {
await runComponentLint(page)
},
})
await expect(page.getByText(/a11y\/useButtonType/)).toBeVisible()
})

Expand All @@ -353,7 +357,11 @@ test('styles diagnostics rows navigate editor to reported line', async ({ page }

await runStylesLint(page)

await waitForLintDiagnosticsIssues(page)
await waitForLintDiagnosticsIssues(page, {
rerunLint: async () => {
await runStylesLint(page)
},
})

const targetDiagnostic = page.getByRole('button', { name: /^L3(:\d+)?\s/ }).first()
await expect(targetDiagnostic).toBeVisible()
Expand All @@ -371,7 +379,11 @@ test('styles lint reports CSS syntax errors', async ({ page }) => {

await runStylesLint(page)

await waitForLintDiagnosticsIssues(page)
await waitForLintDiagnosticsIssues(page, {
rerunLint: async () => {
await runStylesLint(page)
},
})
await expect(page.locator('#diagnostics-styles')).toContainText(
'Biome reported issues.',
)
Expand Down
28 changes: 24 additions & 4 deletions playwright/helpers/app-test-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
export const waitForAppReady = async (page: Page, path = appEntryPath) => {
await navigateToApp(page, path)
await expect(page.getByRole('heading', { name: '@knighted/develop' })).toBeVisible()
await expect

Check failure on line 77 in playwright/helpers/app-test-helpers.ts

View workflow job for this annotation

GitHub Actions / E2E (Playwright, webkit, shard 4/4)

[webkit] › playwright/rendering-modes/core.spec.ts:688:1 › persists theme across reload with fixed layout

1) [webkit] › playwright/rendering-modes/core.spec.ts:688:1 › persists theme across reload with fixed layout Error: expect(received).toBe(expected) // Object.is equality Expected: true Received: false Call Log: - Timeout 90000ms exceeded while waiting on the predicate at helpers/app-test-helpers.ts:77 75 | await navigateToApp(page, path) 76 | await expect(page.getByRole('heading', { name: '@knighted/develop' })).toBeVisible() > 77 | await expect | ^ 78 | .poll(async () => { 79 | const statusText = ( 80 | await page.getByRole('status', { name: 'App status' }).textContent() at waitForAppReady (/home/runner/work/develop/develop/playwright/helpers/app-test-helpers.ts:77:3) at waitForInitialRender (/home/runner/work/develop/develop/playwright/helpers/app-test-helpers.ts:140:3) at /home/runner/work/develop/develop/playwright/rendering-modes/core.spec.ts:696:3
.poll(async () => {
const statusText = (
await page.getByRole('status', { name: 'App status' }).textContent()
Expand Down Expand Up @@ -263,12 +263,32 @@
await page.getByRole('button', { name: 'Styles lint' }).click()
}

export const waitForLintDiagnosticsIssues = async (page: Page) => {
export const waitForLintDiagnosticsIssues = async (
page: Page,
{
rerunLint,
}: {
rerunLint?: () => Promise<void>
} = {},
) => {
const diagnosticsToggle = page.getByRole('button', { name: /^Diagnostics/ })

await expect(diagnosticsToggle).toHaveAttribute('aria-busy', 'false')
await expect(diagnosticsToggle).toHaveClass(/diagnostics-toggle--error/)
await expect(page.getByText(/Rendered \(Lint issues: [1-9]\d*\)/)).toBeVisible()
const expectLintIssuesVisible = async () => {
await expect(diagnosticsToggle).toHaveAttribute('aria-busy', 'false')
await expect(diagnosticsToggle).toHaveClass(/diagnostics-toggle--error/)
await expect(page.getByText(/Rendered \(Lint issues: [1-9]\d*\)/)).toBeVisible()
}

try {
await expectLintIssuesVisible()
} catch (error) {
if (typeof rerunLint !== 'function') {
throw error
}

await rerunLint()
await expectLintIssuesVisible()
}

await ensureDiagnosticsDrawerOpen(page)
await expect(page.locator('#diagnostics-styles')).toContainText(
Expand Down Expand Up @@ -410,7 +430,7 @@
}
}

await expect(toggle).toHaveAttribute('aria-expanded', 'false')

Check failure on line 433 in playwright/helpers/app-test-helpers.ts

View workflow job for this annotation

GitHub Actions / E2E (Playwright, chromium)

[chromium] › playwright/github-pr-drawer/active-context-switch.spec.ts:907:1 › Active PR context rehydrates after token remove and re-add

2) [chromium] › playwright/github-pr-drawer/active-context-switch.spec.ts:907:1 › Active PR context rehydrates after token remove and re-add Error: expect(locator).toHaveAttribute(expected) failed Locator: locator('#workspaces-toggle') Expected: "false" Received: "true" Timeout: 90000ms Call log: - Expect "toHaveAttribute" with timeout 90000ms - waiting for locator('#workspaces-toggle') 93 × locator resolved to <button type="button" aria-expanded="true" id="workspaces-toggle" title="Manage local workspaces" aria-controls="workspaces-drawer" class="diagnostics-toggle workspaces-toggle">…</button> - unexpected value "true" at helpers/app-test-helpers.ts:433 431 | } 432 | > 433 | await expect(toggle).toHaveAttribute('aria-expanded', 'false') | ^ 434 | await expect(page.getByRole('complementary', { name: 'Workspaces' })).toBeHidden() 435 | } 436 | at ensureWorkspacesDrawerClosed (/home/runner/work/develop/develop/playwright/helpers/app-test-helpers.ts:433:24) at openStoredWorkspaceContextById (/home/runner/work/develop/develop/playwright/github-pr-drawer/github-pr-drawer.helpers.ts:267:3) at openMostRecentStoredWorkspaceContext (/home/runner/work/develop/develop/playwright/github-pr-drawer/github-pr-drawer.helpers.ts:328:3) at /home/runner/work/develop/develop/playwright/github-pr-drawer/active-context-switch.spec.ts:1028:3

Check failure on line 433 in playwright/helpers/app-test-helpers.ts

View workflow job for this annotation

GitHub Actions / E2E (Playwright, chromium)

[chromium] › playwright/github-pr-drawer/active-context-switch.spec.ts:361:1 › Switching active workspace to inactive preserves switched-from record integrity

1) [chromium] › playwright/github-pr-drawer/active-context-switch.spec.ts:361:1 › Switching active workspace to inactive preserves switched-from record integrity Error: expect(locator).toHaveAttribute(expected) failed Locator: locator('#workspaces-toggle') Expected: "false" Received: "true" Timeout: 90000ms Call log: - Expect "toHaveAttribute" with timeout 90000ms - waiting for locator('#workspaces-toggle') 93 × locator resolved to <button type="button" aria-expanded="true" id="workspaces-toggle" title="Manage local workspaces" aria-controls="workspaces-drawer" class="diagnostics-toggle workspaces-toggle">…</button> - unexpected value "true" at helpers/app-test-helpers.ts:433 431 | } 432 | > 433 | await expect(toggle).toHaveAttribute('aria-expanded', 'false') | ^ 434 | await expect(page.getByRole('complementary', { name: 'Workspaces' })).toBeHidden() 435 | } 436 | at ensureWorkspacesDrawerClosed (/home/runner/work/develop/develop/playwright/helpers/app-test-helpers.ts:433:24) at openStoredWorkspaceContextById (/home/runner/work/develop/develop/playwright/github-pr-drawer/github-pr-drawer.helpers.ts:267:3) at runActiveWorkspaceSwitchIntegrityScenario (/home/runner/work/develop/develop/playwright/github-pr-drawer/github-pr-drawer.helpers.ts:882:3) at /home/runner/work/develop/develop/playwright/github-pr-drawer/active-context-switch.spec.ts:364:3
await expect(page.getByRole('complementary', { name: 'Workspaces' })).toBeHidden()
}

Expand Down
Loading