Stabilizing test by waiting for the response

Closes #42650

Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
This commit is contained in:
Alexander Schwartz 2025-09-16 19:20:13 +02:00 committed by GitHub
parent 0c5b6398a9
commit 63538629db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,6 +29,7 @@ test.describe("Device activity", () => {
.getByRole("button", { name: "Sign out", exact: true })
.click();
await page2.getByRole("button", { name: "Confirm", exact: true }).click();
await expect(page2.getByTestId("last-alert")).toContainText("Signed out");
// Reload pages and verify the first session is logged out, while the second session remains active.
await page1.reload();
@ -64,6 +65,12 @@ test.describe("Device activity", () => {
.getByRole("button", { name: "Sign out all devices", exact: true })
.click();
await page2.getByRole("button", { name: "Confirm", exact: true }).click();
await expect(
page2.getByRole("heading", {
name: "Sign in to your account",
exact: true,
}),
).toBeVisible();
// Reload only the first page (second page is already logged out), and verify both sessions are logged out.
await page1.reload();
@ -73,12 +80,6 @@ test.describe("Device activity", () => {
exact: true,
}),
).toBeVisible();
await expect(
page2.getByRole("heading", {
name: "Sign in to your account",
exact: true,
}),
).toBeVisible();
} finally {
await context1.close();
await context2.close();