mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
2 years ago
|
// playwright-dev-page.ts
|
||
2 years ago
|
import { Locator, Page, expect } from "@playwright/test";
|
||
2 years ago
|
import { BasePage } from "../Base";
|
||
|
import { GridPage } from "./Grid";
|
||
|
import { ExpandedFormPage } from "./Grid/ExpandedForm";
|
||
2 years ago
|
import { TreeViewPage } from "./TreeView";
|
||
2 years ago
|
|
||
|
export class DashboardPage {
|
||
|
readonly project: any;
|
||
|
readonly page: Page;
|
||
|
readonly tablesSideBar: Locator;
|
||
|
readonly tabBar: Locator;
|
||
2 years ago
|
readonly base: BasePage;
|
||
2 years ago
|
readonly treeView: TreeViewPage;
|
||
2 years ago
|
readonly grid: GridPage;
|
||
|
readonly expandedForm: ExpandedFormPage;
|
||
2 years ago
|
|
||
|
constructor(page: Page, project: any) {
|
||
|
this.page = page;
|
||
2 years ago
|
this.base = new BasePage(page);
|
||
2 years ago
|
this.project = project;
|
||
2 years ago
|
this.tablesSideBar = page.locator(".nc-treeview-container");
|
||
|
this.tabBar = page.locator(".nc-tab-bar");
|
||
2 years ago
|
this.treeView = new TreeViewPage(page, project);
|
||
2 years ago
|
this.grid = new GridPage(page);
|
||
|
this.expandedForm = new ExpandedFormPage(page);
|
||
2 years ago
|
}
|
||
|
|
||
|
async goto() {
|
||
2 years ago
|
await this.page.goto(`/#/nc/${this.project.id}/auth`);
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
async gotoSettings() {
|
||
|
await this.page.locator('[pw-data="nc-project-menu"]').click();
|
||
2 years ago
|
await this.page
|
||
|
.locator('div.nc-project-menu-item:has-text(" Team & Settings")')
|
||
|
.click();
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
async verifyTableIsInTabBar({ title }: { title: string }) {
|
||
2 years ago
|
await this.tabBar
|
||
|
.textContent()
|
||
|
.then((text) => expect(text).toContain(title));
|
||
2 years ago
|
}
|
||
2 years ago
|
}
|