mirror of https://github.com/nocodb/nocodb
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.
48 lines
1.5 KiB
48 lines
1.5 KiB
2 years ago
|
import { expect } from '@playwright/test';
|
||
2 years ago
|
import { SettingsPage } from '.';
|
||
|
import BasePage from '../../Base';
|
||
|
|
||
|
export class MetaDataPage extends BasePage {
|
||
|
private readonly settings: SettingsPage;
|
||
|
|
||
|
constructor(settings: SettingsPage) {
|
||
|
super(settings.rootPage);
|
||
|
this.settings = settings;
|
||
|
}
|
||
|
|
||
|
get() {
|
||
2 years ago
|
return this.settings.get().locator(`[data-nc="nc-settings-subtab-Metadata"]`);
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
async clickReload() {
|
||
2 years ago
|
await this.get().locator(`button:has-text("Reload")`).click();
|
||
2 years ago
|
|
||
|
// todo: Remove this wait
|
||
|
await this.rootPage.waitForTimeout(100);
|
||
|
// await this.get().locator(`.animate-spin`).waitFor({state: 'visible'});
|
||
2 years ago
|
await this.get().locator(`.animate-spin`).waitFor({ state: 'detached' });
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
async sync() {
|
||
2 years ago
|
await this.get().locator(`button:has-text("Sync Now")`).click();
|
||
2 years ago
|
await this.verifyToast({ message: 'Table metadata recreated successfully' });
|
||
|
await this.get().locator(`.animate-spin`).waitFor({ state: 'visible' });
|
||
|
await this.get().locator(`.animate-spin`).waitFor({ state: 'detached' });
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
async verifyRow({ index, model, state }: { index: number; model: string; state: string }) {
|
||
2 years ago
|
await expect(this.get().locator(`tr.ant-table-row`).nth(index).locator(`td.ant-table-cell`).nth(0)).toHaveText(
|
||
|
model,
|
||
|
{
|
||
|
ignoreCase: true,
|
||
|
}
|
||
|
);
|
||
|
await expect(this.get().locator(`tr.ant-table-row`).nth(index).locator(`td.ant-table-cell`).nth(1)).toHaveText(
|
||
|
state,
|
||
|
{
|
||
|
ignoreCase: true,
|
||
|
}
|
||
|
);
|
||
2 years ago
|
}
|
||
2 years ago
|
}
|