mirror of https://github.com/coder/coder.git
wip: commit current test progress
This commit is contained in:
parent
6545327f98
commit
e26b8e4c16
|
@ -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}`);
|
||||
|
|
Loading…
Reference in New Issue