Files
nocodb/tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts
Pranav C d4e5ede2d3 Nc feat/Readonly source followup (#8795)
* feat: allow partial column update (GUI)

* feat: allow partial column update (backend)

* refactor: swagger schema description correction

* feat: allow edit from multi field editor

* fix: allow meta update in api level

* fix: add tooltip and docs link

* fix: multi field editor corrections

* fix: allow table meta update

* fix: allow table meta update

* fix: allow column validation update

* fix: block adding new option directly from cell

* fix: add tooltip for column menu options

* refactor: tooltips

* test: replace index with count as parameter

* fix: corrections

* refactor: hint text update
2024-06-21 20:44:40 +05:30

36 lines
1.2 KiB
TypeScript

import { expect } from '@playwright/test';
import { CellPageObject } from '.';
import BasePage from '../../../Base';
export class RatingCellPageObject 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 select({ index, columnHeader, rating }: { index?: number; columnHeader: string; rating: number }) {
await this.get({ index, columnHeader }).scrollIntoViewIfNeeded();
await this.waitForResponse({
uiAction: async () =>
await this.get({ index, columnHeader })
.locator('.ant-rate-star > div')
.nth(rating - 1)
.click(),
httpMethodsToMatch: ['POST', 'PATCH'],
requestUrlPathToMatch: 'api/v1/db/data/noco/',
});
}
async verify({ index, columnHeader, rating }: { index: number; columnHeader: string; rating: number }) {
const cell = this.get({ index, columnHeader });
await cell.scrollIntoViewIfNeeded();
await expect(cell.locator(`li.ant-rate-star.ant-rate-star-full`)).toHaveCount(rating);
}
}