-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
5 changed files
with
43 additions
and
11 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { mergeTests } from "@playwright/test"; | ||
import { authFixture } from "./auth.fixture"; | ||
import { folderFixture } from "./folder/folder.fixture"; | ||
import { mapFixture } from "./map/map.fixture"; | ||
|
||
export const test = mergeTests(authFixture, mapFixture); | ||
export const test = mergeTests(authFixture, mapFixture, folderFixture); |
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,9 @@ | ||
import test from "@playwright/test"; | ||
import { Folder } from "./folder"; | ||
|
||
export const folderFixture = test.extend<{ folder: Folder }>({ | ||
folder: async ({ page }, use) => { | ||
const folder = new Folder(page); | ||
await use(folder); | ||
}, | ||
}); |
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 { Page } from "@playwright/test"; | ||
|
||
export class Folder { | ||
constructor(public readonly page: Page) {} | ||
|
||
async create(name?: string) { | ||
const hash = crypto.randomUUID().slice(9, 13); | ||
const folderName = name || `E2E Folder ${hash}`; | ||
|
||
await this.page.goto("/system/J100001"); | ||
await this.page.getByLabel("Open Settings Menu").click(); | ||
await this.page.getByRole("menuitem", { name: "Folder Options" }).click(); | ||
await this.page.getByRole("button", { name: "New Folder" }).click(); | ||
await this.page.getByLabel("Name").fill(folderName); | ||
await this.page.getByRole("button", { name: "Create" }).click(); | ||
await this.page.getByLabel("Active Folder").click(); | ||
await this.page | ||
.getByRole("option", { name: folderName, exact: true }) | ||
.click(); | ||
} | ||
} |
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