Skip to content

Commit

Permalink
Randomize E2E map names
Browse files Browse the repository at this point in the history
  • Loading branch information
joonashak committed Dec 24, 2024
1 parent 51036d1 commit c5e8880
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions testing/e2e/fixtures/map/map.fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ 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);
map: async ({ page }, use) => {
const map = new Map(page);
await map.create();
await use(map);
},
Expand Down
11 changes: 4 additions & 7 deletions testing/e2e/fixtures/map/map.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { expect, Page } from "@playwright/test";
import { Account } from "../auth.fixture";

export class Map {
constructor(
public readonly page: Page,
public readonly account: Account,
) {}
constructor(public readonly page: Page) {}

async create() {
const mapName = `E2E Map ${this.account.eveId}`;
async create(name?: string) {
const hash = crypto.randomUUID().slice(9, 13);
const mapName = name || `E2E Map ${hash}`;
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();
Expand Down

0 comments on commit c5e8880

Please sign in to comment.