Skip to content
Open
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
23 changes: 22 additions & 1 deletion packages/app/e2e/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,28 @@ export async function openStatusPopover(page: Page) {

if (!opened) {
await expect(trigger).toBeVisible()
await trigger.click()

for (const timeout of [1500, 3000, undefined]) {
const clicked = await trigger
.click({ force: true, timeout })
.then(() => true)
.catch(() => false)

if (!clicked) {
await trigger.focus().catch(() => undefined)
await page.keyboard.press("Enter").catch(() => undefined)
}

const visible = await popoverBody
.waitFor({ state: "visible", timeout: timeout ?? 5000 })
.then(() => true)
.catch(() => false)

if (visible) {
break
}
}

await expect(popoverBody).toBeVisible()
}

Expand Down
20 changes: 15 additions & 5 deletions packages/app/e2e/status/status-popover.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,21 @@ test("status popover can switch to plugins tab", async ({ page, gotoSession }) =

const { popoverBody } = await openStatusPopover(page)

const pluginsTab = popoverBody.getByRole("tab", { name: /plugins/i })
await pluginsTab.click()

const ariaSelected = await pluginsTab.getAttribute("aria-selected")
expect(ariaSelected).toBe("true")
await expect
.poll(
async () => {
const pluginsTab = popoverBody.getByRole("tab", { name: /plugins/i })
const selected = await pluginsTab.getAttribute("aria-selected").catch(() => undefined)
if (selected === "true") {
return selected
}

await pluginsTab.click({ force: true }).catch(() => undefined)
return (await pluginsTab.getAttribute("aria-selected").catch(() => undefined)) ?? "false"
},
{ timeout: 15_000 },
)
.toBe("true")

const pluginsContent = popoverBody.locator('[role="tabpanel"]:visible').first()
await expect(pluginsContent).toBeVisible()
Expand Down
Loading
Loading