|
|
|
@ -3,12 +3,14 @@ import { GridPage } from "..";
|
|
|
|
|
import { ToolbarFieldsPage } from "./Fields"; |
|
|
|
|
import { ToolbarSortPage } from "./Sort"; |
|
|
|
|
import { ToolbarFilterPage } from "./Filter"; |
|
|
|
|
import { ToolbarShareViewPage } from "./ShareView"; |
|
|
|
|
|
|
|
|
|
export class ToolbarPage extends BasePage { |
|
|
|
|
readonly grid: GridPage; |
|
|
|
|
readonly fields: ToolbarFieldsPage; |
|
|
|
|
readonly sort: ToolbarSortPage; |
|
|
|
|
readonly filter: ToolbarFilterPage; |
|
|
|
|
readonly shareView: ToolbarShareViewPage; |
|
|
|
|
|
|
|
|
|
constructor(grid: GridPage) { |
|
|
|
|
super(grid.rootPage); |
|
|
|
@ -16,6 +18,7 @@ export class ToolbarPage extends BasePage {
|
|
|
|
|
this.fields = new ToolbarFieldsPage(this); |
|
|
|
|
this.sort = new ToolbarSortPage(this); |
|
|
|
|
this.filter = new ToolbarFilterPage(this); |
|
|
|
|
this.shareView = new ToolbarShareViewPage(this); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
get() { |
|
|
|
@ -23,19 +26,39 @@ export class ToolbarPage extends BasePage {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async clickFields() { |
|
|
|
|
const menuOpen = await this.fields.get().isVisible(); |
|
|
|
|
|
|
|
|
|
await this.get().locator(`button:has-text("Fields")`).click(); |
|
|
|
|
|
|
|
|
|
// Wait for the menu to close
|
|
|
|
|
if(menuOpen) await this.fields.get().waitFor({ state: "hidden" }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async clickSort() { |
|
|
|
|
const menuOpen = await this.sort.get().isVisible(); |
|
|
|
|
|
|
|
|
|
await this.get().locator(`button:has-text("Sort")`).click(); |
|
|
|
|
|
|
|
|
|
// Wait for the menu to close
|
|
|
|
|
if(menuOpen) await this.sort.get().waitFor({ state: "hidden" }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async clickFilter() { |
|
|
|
|
const menuOpen = await this.filter.get().isVisible(); |
|
|
|
|
|
|
|
|
|
await this.get().locator(`button:has-text("Filter")`).click(); |
|
|
|
|
|
|
|
|
|
// Wait for the menu to close
|
|
|
|
|
if(menuOpen) await this.filter.get().waitFor({ state: "hidden" }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async clickShareView() { |
|
|
|
|
const menuOpen = await this.shareView.get().isVisible(); |
|
|
|
|
|
|
|
|
|
await this.get().locator(`button:has-text("Share View")`).click(); |
|
|
|
|
|
|
|
|
|
// Wait for the menu to close
|
|
|
|
|
if(menuOpen) await this.shareView.get().waitFor({ state: "hidden" }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async clickAddNewRow() { |
|
|
|
|