|
|
|
@ -16,6 +16,7 @@ import { ToolbarAddEditStackPage } from './AddEditKanbanStack';
|
|
|
|
|
import { ToolbarSearchDataPage } from './SearchData'; |
|
|
|
|
import { RowHeight } from './RowHeight'; |
|
|
|
|
import { MapPage } from '../../Map'; |
|
|
|
|
import { getTextExcludeIconText } from '../../../../tests/utils/general'; |
|
|
|
|
|
|
|
|
|
export class ToolbarPage extends BasePage { |
|
|
|
|
readonly parent: GridPage | GalleryPage | FormPage | KanbanPage | MapPage; |
|
|
|
@ -82,14 +83,26 @@ export class ToolbarPage extends BasePage {
|
|
|
|
|
|
|
|
|
|
async verifyFieldsButtonIsVisibleWithTextAndIcon() { |
|
|
|
|
await expect(this.get().locator(`button.nc-fields-menu-btn`)).toBeVisible(); |
|
|
|
|
await expect(this.get().locator(`button.nc-fields-menu-btn`)).toHaveText('Fields'); |
|
|
|
|
expect(await this.get().locator(`button.nc-fields-menu-btn`).locator(`svg`).count()).toBe(2); |
|
|
|
|
|
|
|
|
|
// menu text
|
|
|
|
|
const fieldLocator = await this.get().locator(`button.nc-fields-menu-btn`); |
|
|
|
|
const fieldText = await getTextExcludeIconText(fieldLocator); |
|
|
|
|
await expect(fieldText).toBe('Fields'); |
|
|
|
|
|
|
|
|
|
// icons count within fields menu button
|
|
|
|
|
expect(await this.get().locator(`button.nc-fields-menu-btn`).locator(`.material-symbols-outlined`).count()).toBe(2); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async verifyFieldsButtonIsVisibleWithoutTextButIcon() { |
|
|
|
|
await expect(this.get().locator(`button.nc-fields-menu-btn`)).toBeVisible(); |
|
|
|
|
await expect(this.get().locator(`button.nc-fields-menu-btn`)).not.toHaveText('Fields'); |
|
|
|
|
expect(await this.get().locator(`button.nc-fields-menu-btn`).locator(`svg`).count()).toBe(2); |
|
|
|
|
|
|
|
|
|
// menu text
|
|
|
|
|
const fieldLocator = await this.get().locator(`button.nc-fields-menu-btn`); |
|
|
|
|
const fieldText = await getTextExcludeIconText(fieldLocator); |
|
|
|
|
await expect(fieldText).not.toBe('Fields'); |
|
|
|
|
|
|
|
|
|
// icons count within fields menu button
|
|
|
|
|
expect(await this.get().locator(`button.nc-fields-menu-btn`).locator(`.material-symbols-outlined`).count()).toBe(2); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async clickFilter({ |
|
|
|
|