diff --git a/tests/playwright/pages/Dashboard/common/Cell/DateTimeCell.ts b/tests/playwright/pages/Dashboard/common/Cell/DateTimeCell.ts index 9d876726cb..0445b7fa60 100644 --- a/tests/playwright/pages/Dashboard/common/Cell/DateTimeCell.ts +++ b/tests/playwright/pages/Dashboard/common/Cell/DateTimeCell.ts @@ -20,14 +20,38 @@ export class DateTimeCellPageObject extends BasePage { }); } - async selectDateTime({ + async selectDate({ // date in format `YYYY-MM-DD` - // time in format 'HH:mm' - dateTime, + date, }: { - dateTime: string; + date: string; }) { - await this.rootPage.locator(`td[title="${dateTime}"]`).click(); + await this.rootPage.locator(`td[title="${date}"]`).click(); + } + + async selectTime({ + // hour: 0 - 23 + // minute: 0 - 59 + // second: 0 - 59 + hour, + minute, + second, + }: { + hour: string; + minute: string; + second?: string; + }) { + await this.rootPage + .locator(`.ant-picker-time-panel-column:nth-child(1) > ant-picker-time-panel-cell:nth-child(${hour})`) + .click(); + await this.rootPage + .locator(`.ant-picker-time-panel-column:nth-child(2) > ant-picker-time-panel-cell:nth-child(${minute})`) + .click(); + if (second != null) { + await this.rootPage + .locator(`.ant-picker-time-panel-column:nth-child(3) > ant-picker-time-panel-cell:nth-child(${second})`) + .click(); + } } async close() {