多维表格
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.

26 lines
726 B

import BasePage from '../../Base';
import { CalendarPage } from './index';
export class CalendarYearPage extends BasePage {
readonly parent: CalendarPage;
constructor(parent: CalendarPage) {
super(parent.rootPage);
this.parent = parent;
}
get() {
return this.rootPage.getByTestId('nc-calendar-year-view');
}
getMonth({ index }: { index: number }) {
return this.get().getByTestId('nc-calendar-year-view-month-selector').nth(index);
}
async selectDate({ monthIndex, dayIndex }: { monthIndex: number; dayIndex: number }) {
const month = this.getMonth({ index: monthIndex });
const day = month.getByTestId('nc-calendar-date').nth(dayIndex);
await day.click({ force: true });
}
}