mirror of
https://codeberg.org/Kankys/musicCalendar.git
synced 2026-11-11 13:54:36 +01:00
21 lines
538 B
TypeScript
21 lines
538 B
TypeScript
import { expect, type Locator, type Page } from '@playwright/test';
|
|
|
|
export class HomePage {
|
|
readonly page: Page;
|
|
|
|
constructor(page: Page) {
|
|
this.page = page;
|
|
}
|
|
|
|
// Přidej metodu pro navigaci na konkrétní soubor
|
|
async navigate(file: string = 'index.html') {
|
|
// Pokud jsme na lokálu, přidáme složku /web/
|
|
// Pokud jsme na produkci, předpokládáme root /
|
|
const prefix = process.env.BASE_URL?.includes('music.lukan.cz') ? '' : 'web/';
|
|
await this.page.goto(`${prefix}${file}`);
|
|
}
|
|
|
|
|
|
|
|
}
|