Browse Source

test: erd test correction

nc-refactor/ds
Pranav C 1 month 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>
</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">
<NcTabs v-model:activeKey="openedTab" class="nc-source-tab w-full">
<a-tab-pane key="erd">

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

@ -20,11 +20,15 @@ export class DataSourcesPage extends BasePage {
}
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 }) {
await this.get().locator('.ds-table-row', { hasText: dataSourceName }).locator('button:has-text("ERD")').click();
async openErd({ rowIndex }: { rowIndex: number }) {
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 } = {}) {

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

@ -45,8 +45,10 @@ test.describe('Erd', () => {
};
const openProjectErd = async () => {
await dashboard.baseView.tab_dataSources.click();
await dashboard.baseView.dataSources.openERD({ rowIndex: 0 });
await dashboard.treeView.baseSettings({ title: context.base.title });
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) => {

Loading…
Cancel
Save