-
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
49 additions
and
15 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,4 +1,5 @@ | ||
import { mergeTests } from "@playwright/test"; | ||
import { authFixture } from "./auth.fixture"; | ||
import { mapFixture } from "./map/map.fixture"; | ||
|
||
export const test = mergeTests(authFixture); | ||
export const test = mergeTests(authFixture, mapFixture); |
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,10 @@ | ||
import { authFixture } from "../auth.fixture"; | ||
import { Map } from "./map"; | ||
|
||
export const mapFixture = authFixture.extend<{ map: Map }>({ | ||
map: async ({ page, account }, use) => { | ||
const map = new Map(page, account); | ||
await map.create(); | ||
await use(map); | ||
}, | ||
}); |
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,31 @@ | ||
import { expect, Page } from "@playwright/test"; | ||
import { Account } from "../auth.fixture"; | ||
|
||
export class Map { | ||
constructor( | ||
public readonly page: Page, | ||
public readonly account: Account, | ||
) {} | ||
|
||
async create() { | ||
const mapName = `E2E Map ${this.account.eveId}`; | ||
await this.page.goto("/system/J104809"); | ||
await this.page.getByRole("button", { name: "Select active map" }).click(); | ||
await this.page.getByRole("menuitem", { name: "New Map" }).click(); | ||
await this.page.getByLabel("Name").fill(mapName); | ||
await this.page.getByLabel("Root System").fill("J100001"); | ||
await this.page | ||
.getByRole("option", { name: "J100001", exact: true }) | ||
.click(); | ||
await this.page.getByRole("button", { name: "Save" }).click(); | ||
await this.page.getByRole("menuitem", { name: mapName }).click(); | ||
|
||
await expect( | ||
this.page.getByRole("button", { name: "Select active map" }), | ||
).toContainText(mapName); | ||
} | ||
|
||
asd() { | ||
// Dummy method for testing map fixture. | ||
} | ||
} |
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