Files
nocodb/tests/playwright/pages/Dashboard/common/Cell/DateCell.ts
Raju Udava b2134c0ff9 test: sync
Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
2023-08-31 15:38:24 +05:30

43 lines
1.1 KiB
TypeScript

import { CellPageObject } from '.';
import BasePage from '../../../Base';
import { expect } from '@playwright/test';
export class DateCellPageObject extends BasePage {
readonly cell: CellPageObject;
constructor(cell: CellPageObject) {
super(cell.rootPage);
this.cell = cell;
}
get({ index, columnHeader }: { index?: number; columnHeader: string }) {
return this.cell.get({ index, columnHeader });
}
async open({ index, columnHeader }: { index: number; columnHeader: string }) {
await this.cell.dblclick({
index,
columnHeader,
});
}
async verify({ index, columnHeader, date }: { index: number; columnHeader: string; date: string }) {
const cell = this.get({ index, columnHeader });
await cell.scrollIntoViewIfNeeded();
await expect(cell.locator(`[title="${date}"]`)).toBeVisible();
}
async selectDate({
// date in format `YYYY-MM-DD`
date,
}: {
date: string;
}) {
await this.rootPage.locator(`td[title="${date}"]`).click();
}
async close() {
await this.rootPage.keyboard.press('Escape');
}
}