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