Files
nocodb/tests/playwright/pages/Dashboard/ProjectView/Metadata.ts
Raju Udava f1d4013d16 Nc fix/rich perf (#10528)
* fix: rich text performance issue

* fix: rich text limit number of chars for canvas

* fix: flaky barcode tests

* fix: avoid duplicate trigger

* test: flaky kanban

* test: flaky meta sync

* test: flaky grid

* test: add flag to kanban calls

Signed-off-by: mertmit <mertmit99@gmail.com>

---------

Signed-off-by: mertmit <mertmit99@gmail.com>
Co-authored-by: mertmit <mertmit99@gmail.com>
2025-02-18 15:45:47 +03:00

54 lines
1.8 KiB
TypeScript

import { expect } from '@playwright/test';
import BasePage from '../../Base';
import { getTextExcludeIconText } from '../../../tests/utils/general';
import { DataSourcePage } from './DataSourcePage';
export class MetaDataPage extends BasePage {
constructor(dataSource: DataSourcePage) {
super(dataSource.rootPage);
}
get() {
return this.rootPage.locator('div.ant-modal-content');
}
async clickReload() {
await this.get().locator(`button:has-text("Reload")`).click();
// todo: Remove this wait
await this.rootPage.waitForTimeout(100);
// await this.get().locator(`.animate-spin`).waitFor({state: 'visible'});
await this.get().locator(`.animate-spin`).waitFor({ state: 'detached', timeout: 10000 });
}
async close() {
await this.get().click();
await this.rootPage.keyboard.press('Escape');
await this.rootPage.keyboard.press('Escape');
await this.rootPage.waitForSelector('div.ant-modal-content', {
state: 'hidden',
});
}
async sync() {
await this.get().locator(`button:has-text("Sync Now")`).click();
await this.verifyToast({ message: 'Table metadata recreated successfully' });
// wait for clickability of the sync button
await this.get().locator(`.sync-completed`).waitFor({ state: 'visible', timeout: 10000 });
await this.get().locator(`.sync-completed`).click();
}
async verifyRow({ index, model, state }: { index: number; model: string; state: string }) {
const fieldLocator = this.get().locator(`tr.nc-table-row`).nth(index).locator(`td.nc-table-cell`).nth(0);
const fieldText = await getTextExcludeIconText(fieldLocator);
expect(fieldText).toBe(model);
await expect(this.get().locator(`tr.nc-table-row`).nth(index).locator(`td.nc-table-cell`).nth(1)).toHaveText(
state,
{
ignoreCase: true,
}
);
}
}