-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
942432b
commit 3e1bfd2
Showing
7 changed files
with
91 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { test } from "../utils/fixtures/base"; | ||
|
||
test("Is accessible on all device types for admin user", async ({ | ||
adminHomePage, | ||
}) => { | ||
await adminHomePage.goto("/admin"); | ||
await adminHomePage.e2eA11y(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { test } from "@playwright/test"; | ||
import { e2eA11y, logInAdminUser, logInStateUser } from "../utils"; | ||
|
||
test("Is accessible on all device types for state user", async ({ page }) => { | ||
await logInStateUser(page); | ||
await e2eA11y(page, "/help"); | ||
}); | ||
|
||
test("Is accessible on all device types for admin user", async ({ page }) => { | ||
await logInAdminUser(page); | ||
await e2eA11y(page, "/help"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { test } from "../utils/fixtures/base"; | ||
import { BrowserContext, Page } from "@playwright/test"; | ||
import ProfilePage from "../utils/pageObjects/profile.page"; | ||
|
||
let adminPage: Page; | ||
let userPage: Page; | ||
let adminContext: BrowserContext; | ||
let userContext: BrowserContext; | ||
|
||
test.beforeAll(async ({ browser }) => { | ||
adminContext = await browser.newContext({ | ||
storageState: ".auth/admin.json", | ||
}); | ||
adminPage = await adminContext.newPage(); | ||
|
||
userContext = await browser.newContext({ | ||
storageState: ".auth/user.json", | ||
}); | ||
userPage = await userContext.newPage(); | ||
}); | ||
|
||
test.afterAll(async () => { | ||
await adminContext.close(); | ||
await userContext.close(); | ||
}); | ||
|
||
test.describe("Admin profile", () => { | ||
test( | ||
"Is accessible on all device types for admin user", | ||
{ tag: "@admin" }, | ||
async () => { | ||
const profilePage = new ProfilePage(adminPage); | ||
await profilePage.goto(); | ||
await profilePage.e2eA11y(); | ||
} | ||
); | ||
}); | ||
|
||
test.describe("State user profile", { tag: "@user" }, () => { | ||
test("Is accessible on all device types for state user", async () => { | ||
const profilePage = new ProfilePage(userPage); | ||
await profilePage.goto(); | ||
await profilePage.e2eA11y(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Locator, Page } from "@playwright/test"; | ||
import BasePage from "./base.page"; | ||
|
||
export default class ProfilePage extends BasePage { | ||
public path = "/profile"; | ||
|
||
readonly page: Page; | ||
readonly title: Locator; | ||
readonly bannerEditorButton: Locator; | ||
|
||
constructor(page: Page) { | ||
super(page); | ||
this.page = page; | ||
this.title = page.getByRole("heading", { | ||
name: "My Account", | ||
}); | ||
this.bannerEditorButton = page.getByRole("button", { | ||
name: "Banner Editor", | ||
}); | ||
} | ||
} |