test: sync

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
This commit is contained in:
Raju Udava
2023-08-31 15:38:24 +05:30
parent 2a985cb1b8
commit b2134c0ff9
47 changed files with 653 additions and 477 deletions

View File

@@ -1,15 +1,18 @@
import BasePage from '../../Base';
import { ProjectViewPage } from './index';
import { Locator } from '@playwright/test';
import { MetaDataPage } from './Metadata';
export class DataSourcePage extends BasePage {
readonly projectView: ProjectViewPage;
readonly databaseType: Locator;
readonly metaData: MetaDataPage;
constructor(projectView: ProjectViewPage) {
super(projectView.rootPage);
this.projectView = projectView;
this.databaseType = this.get().locator('.nc-extdb-db-type');
this.metaData = new MetaDataPage(this);
}
get() {
@@ -28,12 +31,22 @@ export class DataSourcePage extends BasePage {
return list;
}
async openMetaSync({ rowIndex }: { rowIndex: number }) {
// 0th offset for header
const row = this.get()
.locator('.ds-table-row')
.nth(rowIndex + 1);
await row.locator('button.nc-action-btn:has-text("Sync Metadata")').click();
}
async openERD({ rowIndex }: { rowIndex: number }) {
// hardwired
await this.rootPage.locator('button.nc-action-btn').nth(1).click();
// await this.rootPage.locator('button.nc-action-btn:has-text("Relations")').click();
// const row = this.get().locator('.ds-table-row').nth(rowIndex);
// await row.locator('.ds-table-actions').locator('button.nc-action-btn').waitFor();
// await row.locator('.ds-table-actions').locator('button.nc-action-btn').nth(1).click();
// 0th offset for header
const row = this.get()
.locator('.ds-table-row')
.nth(rowIndex + 1);
await row.locator('button.nc-action-btn:has-text("Relations")').click();
}
}