1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-05-01 15:49:51 +00:00
bramw_baserow/e2e-tests/pages/baserowPage.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
666 B
TypeScript
Raw Permalink Normal View History

2024-11-14 12:30:42 +00:00
import { Page, expect } from "@playwright/test";
import { baserowConfig } from "../playwright.config";
import { User } from "../fixtures/user";
2023-01-30 13:26:33 +00:00
export class BaserowPage {
2024-11-14 12:30:42 +00:00
readonly page: Page;
readonly baseUrl = baserowConfig.PUBLIC_WEB_FRONTEND_URL;
pageUrl: string;
2023-01-30 13:26:33 +00:00
constructor(page: Page) {
2024-11-14 12:30:42 +00:00
this.page = page;
2023-01-30 13:26:33 +00:00
}
2024-11-14 12:30:42 +00:00
async authenticate(user: User) {
await this.page.goto(`${this.baseUrl}?token=${user.refreshToken}`);
}
2023-01-30 13:26:33 +00:00
async goto() {
2024-11-14 12:30:42 +00:00
await this.page.goto(this.getFullUrl());
2023-01-30 13:26:33 +00:00
}
async checkOnPage() {
2024-11-14 12:30:42 +00:00
await expect(this.page.url()).toBe(this.getFullUrl());
2023-01-30 13:26:33 +00:00
}
getFullUrl() {
2024-11-14 12:30:42 +00:00
return `${this.baseUrl}/${this.pageUrl}`;
2023-01-30 13:26:33 +00:00
}
}