wip: commit current test progress

This commit is contained in:
Parkreiner 2024-05-03 19:19:57 +00:00
parent 6545327f98
commit e26b8e4c16
1 changed files with 11 additions and 8 deletions

View File

@ -1,5 +1,6 @@
import { test, expect } from "@playwright/test";
import { accessibleDropdownLabel } from "modules/dashboard/Navbar/UserDropdown/UserDropdown";
import { Language } from "modules/dashboard/Navbar/UserDropdown/UserDropdownContent";
import { getApplicationName } from "utils/appearance";
import { setupApiCalls } from "../api";
import { assertNoUncaughtRuntimeError } from "../helpers";
@ -10,17 +11,19 @@ test.beforeEach(async ({ page }) => await beforeCoderTest(page));
// Test assumes that global setup will automatically handle the sign in process
test("Signing out", async ({ page, baseURL }) => {
await setupApiCalls(page);
await page.goto("/workspaces");
const name = new RegExp(accessibleDropdownLabel);
const dropdown = page.getByRole("button", { name });
await expect(dropdown).toBeAttached({
timeout: 10_000,
});
const dropdownName = new RegExp(accessibleDropdownLabel);
const dropdown = page.getByRole("button", { name: dropdownName });
await dropdown.click();
const signOutButton = page.getByRole("button", { name: /Sign Out/ });
await signOutButton.click();
const signOutOption = page.getByRole("menuitem", {
name: Language.signOutLabel,
});
await expect(signOutOption).toBeAttached({ timeout: 2_000 });
await signOutOption.click();
const applicationName = getApplicationName();
await expect(page).toHaveTitle(`Sign in to ${applicationName}`);