Browse Source

test: erd test correction

pull/8510/head
Pranav C 5 months ago
parent
commit
40f02d5be7
  1. 2
      packages/nc-gui/components/dashboard/settings/DataSources.vue
  2. 10
      tests/playwright/pages/Dashboard/Settings/DataSources.ts
  3. 6
      tests/playwright/tests/db/features/erd.spec.ts

2
packages/nc-gui/components/dashboard/settings/DataSources.vue

@ -323,7 +323,7 @@ const openedTab = ref('erd')
</a-breadcrumb-item> </a-breadcrumb-item>
</a-breadcrumb> </a-breadcrumb>
</div> </div>
<div class="flex flex-row w-full h-full nc-data-sources-view flex-grow"> <div data-testid="nc-settings-datasources" class="flex flex-row w-full h-full nc-data-sources-view flex-grow">
<template v-if="activeSource"> <template v-if="activeSource">
<NcTabs v-model:activeKey="openedTab" class="nc-source-tab w-full"> <NcTabs v-model:activeKey="openedTab" class="nc-source-tab w-full">
<a-tab-pane key="erd"> <a-tab-pane key="erd">

10
tests/playwright/pages/Dashboard/Settings/DataSources.ts

@ -20,11 +20,15 @@ export class DataSourcesPage extends BasePage {
} }
get() { get() {
return this.settings.get().locator(`[data-testid="nc-settings-subtab-Data Sources"]`); return this.settings.get().locator('[data-testid="nc-settings-datasources"]');
} }
async openErd({ dataSourceName }: { dataSourceName: string }) { async openErd({ rowIndex }: { rowIndex: number }) {
await this.get().locator('.ds-table-row', { hasText: dataSourceName }).locator('button:has-text("ERD")').click(); const row = this.get()
.locator('.ds-table-row')
.nth(rowIndex + 1);
await row.click();
await this.get().getByTestId('nc-erd-tab').click();
} }
async openAcl({ dataSourceName = defaultBaseName }: { dataSourceName?: string } = {}) { async openAcl({ dataSourceName = defaultBaseName }: { dataSourceName?: string } = {}) {

6
tests/playwright/tests/db/features/erd.spec.ts

@ -45,8 +45,10 @@ test.describe('Erd', () => {
}; };
const openProjectErd = async () => { const openProjectErd = async () => {
await dashboard.baseView.tab_dataSources.click(); await dashboard.treeView.baseSettings({ title: context.base.title });
await dashboard.baseView.dataSources.openERD({ rowIndex: 0 }); await dashboard.settings.selectTab({ tab: 'dataSources' });
await dashboard.settings.dataSources.openErd({ rowIndex: 0 });
// await dashboard.baseView.dataSources.openERD({ rowIndex: 0 });
}; };
const openErdOfATable = async (tableName: string) => { const openErdOfATable = async (tableName: string) => {

Loading…
Cancel
Save