diff --git a/tests/playwright/pages/Dashboard/ProjectView/Metadata.ts b/tests/playwright/pages/Dashboard/ProjectView/Metadata.ts index cbddf82810..b6ea7d2d81 100644 --- a/tests/playwright/pages/Dashboard/ProjectView/Metadata.ts +++ b/tests/playwright/pages/Dashboard/ProjectView/Metadata.ts @@ -8,7 +8,7 @@ export class MetaDataPage extends BasePage { super(dataSource.rootPage); } - get() { + get(options?: any) { return this.rootPage.locator('div.ant-modal-content'); } @@ -25,7 +25,10 @@ export class MetaDataPage extends BasePage { await this.get().click(); await this.rootPage.keyboard.press('Escape'); await this.rootPage.keyboard.press('Escape'); - await this.get().waitFor({ state: 'detached' }); + // await this.get().toHaveLength(0) // .waitFor({ state: 'detached' }); + await this.rootPage.waitForSelector('div.ant-modal-content', { + state: 'hidden', + }); } async sync() { diff --git a/tests/playwright/pages/Dashboard/Settings/DataSources.ts b/tests/playwright/pages/Dashboard/Settings/DataSources.ts index 301a24d6a0..3878342886 100644 --- a/tests/playwright/pages/Dashboard/Settings/DataSources.ts +++ b/tests/playwright/pages/Dashboard/Settings/DataSources.ts @@ -30,15 +30,16 @@ export class DataSourcesPage extends BasePage { await row.click(); await this.get().getByTestId('nc-erd-tab').click(); } - async openAcl({ dataSourceName = defaultBaseName }: { dataSourceName?: string } = {}) { await this.get().locator('.ds-table-row', { hasText: dataSourceName }).locator('button:has-text("UI ACL")').click(); } - async openMetaSync({ dataSourceName = defaultBaseName }: { dataSourceName?: string } = {}) { - await this.get() - .locator('.ds-table-row', { hasText: dataSourceName }) - .locator('button:has-text("Sync Metadata")') - .click(); + async openMetaSync({ rowIndex }: { rowIndex: number }) { + // 0th offset for header + const row = this.get() + .locator('.ds-table-row') + .nth(rowIndex + 1); + await row.click(); + await this.get().getByTestId('nc-meta-sync-tab').click(); } } diff --git a/tests/playwright/tests/db/features/metaSync.spec.ts b/tests/playwright/tests/db/features/metaSync.spec.ts index 61517f1fbd..e11b3c7cd3 100644 --- a/tests/playwright/tests/db/features/metaSync.spec.ts +++ b/tests/playwright/tests/db/features/metaSync.spec.ts @@ -36,8 +36,12 @@ test.describe('Meta sync', () => { test('Meta sync', async () => { test.setTimeout(process.env.CI ? 100000 : 70000); - await dashboard.baseView.tab_dataSources.click(); - await dashboard.baseView.dataSources.openMetaSync({ rowIndex: 0 }); + // await dashboard.baseView.tab_dataSources.click(); + // await dashboard.baseView.dataSources.openMetaSync({ rowIndex: 0 }); + + await dashboard.treeView.baseSettings({ title: context.base.title }); + await dashboard.settings.selectTab({ tab: 'dataSources' }); + await dashboard.settings.dataSources.openMetaSync({ rowIndex: 0 }); await dbExec(`CREATE TABLE table1 (id INT NOT NULL, col1 INT NULL, PRIMARY KEY (id))`); await dbExec(`CREATE TABLE table2 (id INT NOT NULL, col1 INT NULL, PRIMARY KEY (id))`); @@ -247,8 +251,9 @@ test.describe('Meta sync', () => { `INSERT INTO table1 (id, col1, col2, col3, col4) VALUES (1,1,1,1,1), (2,2,2,2,2), (3,3,3,3,3), (4,4,4,4,4), (5,5,5,5,5), (6,6,6,6,6), (7,7,7,7,7), (8,8,8,8,8), (9,9,9,9,9);` ); - await dashboard.baseView.tab_dataSources.click(); - await dashboard.baseView.dataSources.openMetaSync({ rowIndex: 0 }); + await dashboard.treeView.baseSettings({ title: context.base.title }); + await dashboard.settings.selectTab({ tab: 'dataSources' }); + await dashboard.settings.dataSources.openMetaSync({ rowIndex: 0 }); await metaData.clickReload(); await metaData.sync();