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.
39 lines
1.2 KiB
39 lines
1.2 KiB
1 year ago
|
import BasePage from '../../../Base';
|
||
|
import { GridPage } from '../../Grid';
|
||
|
import { GalleryPage } from '../../Gallery';
|
||
|
import { KanbanPage } from '../../Kanban';
|
||
|
import { FormPage } from '../../Form';
|
||
|
|
||
|
export class WorkspaceMenuObject extends BasePage {
|
||
|
constructor(parent: GridPage | GalleryPage | KanbanPage | FormPage) {
|
||
|
super(parent.rootPage);
|
||
|
}
|
||
|
|
||
|
get() {
|
||
|
return this.rootPage.locator(`.nc-dropdown-workspace-menu`);
|
||
|
}
|
||
|
|
||
|
async toggle() {
|
||
|
await this.rootPage.locator('[data-testid="nc-workspace-menu"]').click();
|
||
|
}
|
||
|
|
||
|
async click({ menu, subMenu }: { menu: string; subMenu: string }) {
|
||
|
const pMenu = this.rootPage.locator(`.nc-dropdown-workspace-menu:visible`);
|
||
|
await pMenu.locator(`div.nc-workspace-menu-item:has-text("${menu}"):visible`).click();
|
||
|
await this.rootPage.waitForTimeout(2000);
|
||
|
|
||
|
if (subMenu) {
|
||
|
await this.rootPage.locator(`div.nc-workspace-menu-item:has-text("${subMenu}"):visible`).click();
|
||
|
await this.rootPage.waitForTimeout(1000);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
async clickPreview(role: string) {
|
||
|
await this.click({
|
||
|
menu: 'Preview as',
|
||
|
subMenu: role,
|
||
|
});
|
||
|
await this.rootPage.waitForTimeout(2500);
|
||
|
}
|
||
|
}
|