mirror of https://github.com/nocodb/nocodb
DarkPhoenix2704
10 months ago
6 changed files with 113 additions and 6 deletions
@ -0,0 +1,45 @@
|
||||
import { Locator } from '@playwright/test'; |
||||
import BasePage from '../../../Base'; |
||||
import { TopbarSharePage } from './Share'; |
||||
import { CalendarPage } from './index'; |
||||
|
||||
export class CalendarTopbarPage extends BasePage { |
||||
readonly parent: CalendarPage; |
||||
readonly share: TopbarSharePage; |
||||
|
||||
readonly today_btn: Locator; |
||||
readonly prev_btn: Locator; |
||||
readonly next_btn: Locator; |
||||
|
||||
readonly side_bar_btn: Locator; |
||||
|
||||
constructor(parent: CalendarPage) { |
||||
super(parent.rootPage); |
||||
this.parent = parent; |
||||
|
||||
this.next_btn = this.get().getByTestId('nc-calendar-next-btn'); |
||||
this.prev_btn = this.get().getByTestId('nc-calendar-prev-btn'); |
||||
this.today_btn = this.get().getByTestId('nc-calendar-today-btn'); |
||||
|
||||
this.side_bar_btn = this.get().getByTestId('nc-calendar-side-bar-btn'); |
||||
} |
||||
|
||||
get() { |
||||
return this.rootPage.getByTestId('nc-calendar-topbar'); |
||||
} |
||||
|
||||
async clickPrev() { |
||||
await this.prev_btn.click(); |
||||
} |
||||
async clickNext() { |
||||
await this.next_btn.click(); |
||||
} |
||||
async clickToday() { |
||||
await this.today_btn.click(); |
||||
} |
||||
|
||||
async toggleSideBar() { |
||||
await this.side_bar_btn.click(); |
||||
await this.rootPage.waitForTimeout(500); |
||||
} |
||||
} |
@ -0,0 +1,28 @@
|
||||
import { DashboardPage } from '..'; |
||||
import BasePage from '../../Base'; |
||||
import { ToolbarPage } from '../common/Toolbar'; |
||||
import { TopbarPage } from '../common/Topbar'; |
||||
import { CalendarTopbarPage } from './CalendarTopBar'; |
||||
|
||||
export class CalendarPage extends BasePage { |
||||
readonly dashboard: DashboardPage; |
||||
readonly toolbar: ToolbarPage; |
||||
readonly topbar: TopbarPage; |
||||
readonly calendarTopbar: CalendarTopbarPage; |
||||
|
||||
constructor(dashboard: DashboardPage) { |
||||
super(dashboard.rootPage); |
||||
this.dashboard = dashboard; |
||||
this.toolbar = new ToolbarPage(this); |
||||
this.topbar = new TopbarPage(this); |
||||
this.calendarTopbar = new CalendarTopbarPage(this); |
||||
} |
||||
|
||||
get() { |
||||
return this.get().getByTestId('nc-calendar-wrapper'); |
||||
} |
||||
|
||||
async waitLoading() { |
||||
await this.rootPage.waitForTimeout(2000); |
||||
} |
||||
} |
@ -0,0 +1,19 @@
|
||||
import BasePage from '../../../Base'; |
||||
import { ToolbarPage } from './index'; |
||||
|
||||
export class ToolbarCalendarViewModePage extends BasePage { |
||||
readonly toolbar: ToolbarPage; |
||||
|
||||
constructor(toolbar: ToolbarPage) { |
||||
super(toolbar.rootPage); |
||||
this.toolbar = toolbar; |
||||
} |
||||
|
||||
get() { |
||||
return this.rootPage.getByTestId('nc-calendar-view-mode'); |
||||
} |
||||
|
||||
changeCalendarView({ title }: { title: string }) { |
||||
await this.get().getByTestId(`nc-calendar-view-mode-${title}`).click(); |
||||
} |
||||
} |
Loading…
Reference in new issue