mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-01 06:36:56 +00:00
* fix(nc-gui): reduce font weight of connection name col cell * fix(nc-gui): show spinner in edit source modal while loading integration * fix(nc-gui): show loading spinner in create source, create/edit connection modal * fix(nc-gui): monor changes * chore(nc-gui): lint * fix(nc-gui): remove extra integration pagemode check condition * fix(nc-gui): update ds test case * feat(nc-gui): add AI integration category * fix: move syncDataType and IntegrationCategoryType enum to noco-sdk * fix(nc-gui): cleanup unused code * fix(nc-gui): integration list modal open issue from create source modal * chore(nc-gui): lint * fix(nc-gui): prevent unnecessarily load integration api calls * fix(nc-gui): handle reset integration data on base change * fix(nc-gui): add missing sync pr changes
109 lines
3.5 KiB
TypeScript
109 lines
3.5 KiB
TypeScript
import BasePage from '../../Base';
|
|
import { ProjectViewPage } from './index';
|
|
import { Locator } from '@playwright/test';
|
|
import { MetaDataPage } from './Metadata';
|
|
import { AuditPage } from './Audit';
|
|
import { SourcePage } from './SourcePage';
|
|
import { AclPage } from './Acl';
|
|
import { defaultBaseName } from '../../../constants';
|
|
|
|
export class DataSourcePage extends BasePage {
|
|
readonly baseView: ProjectViewPage;
|
|
readonly databaseType: Locator;
|
|
readonly metaData: MetaDataPage;
|
|
readonly audit: AuditPage;
|
|
readonly source: SourcePage;
|
|
readonly acl: AclPage;
|
|
|
|
constructor(baseView: ProjectViewPage) {
|
|
super(baseView.rootPage);
|
|
this.baseView = baseView;
|
|
this.databaseType = this.get().locator('.nc-extdb-db-type');
|
|
this.metaData = new MetaDataPage(this);
|
|
this.audit = new AuditPage(this);
|
|
this.source = new SourcePage(this);
|
|
this.acl = new AclPage(this);
|
|
}
|
|
|
|
get() {
|
|
return this.rootPage.locator('.nc-data-sources-view');
|
|
}
|
|
|
|
getDsDetailsModal() {
|
|
return this.rootPage.locator('.nc-active-data-sources-view');
|
|
}
|
|
|
|
async closeDsDetailsModal() {
|
|
await this.getDsDetailsModal().locator('.nc-close-btn').click();
|
|
await this.getDsDetailsModal().waitFor({ state: 'hidden' });
|
|
}
|
|
|
|
async getDatabaseTypeList() {
|
|
await this.databaseType.click();
|
|
const nodes = this.rootPage.locator('.nc-dropdown-ext-db-type').locator('.ant-select-item');
|
|
const list = [];
|
|
for (let i = 0; i < (await nodes.count()); i++) {
|
|
const node = nodes.nth(i);
|
|
const text = await node.textContent();
|
|
list.push(text);
|
|
}
|
|
return list;
|
|
}
|
|
|
|
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.getDsDetailsModal().waitFor({ state: 'visible' });
|
|
await this.getDsDetailsModal().getByTestId('nc-meta-sync-tab').click();
|
|
// await row.getByTestId('nc-data-sources-view-meta-sync').click();
|
|
}
|
|
|
|
async openERD({ rowIndex }: { rowIndex: number }) {
|
|
// 0th offset for header
|
|
const row = this.get()
|
|
.locator('.ds-table-row')
|
|
.nth(rowIndex + 1);
|
|
|
|
await row.click();
|
|
|
|
// kludge: only in testing it's not rendering all tables
|
|
await this.getDsDetailsModal().getByTestId('nc-acl-tab').click();
|
|
await this.getDsDetailsModal().getByTestId('nc-erd-tab').click();
|
|
}
|
|
|
|
async openAudit({ rowIndex }: { rowIndex: number }) {
|
|
// 0th offset for header
|
|
const row = this.get()
|
|
.locator('.ds-table-row')
|
|
.nth(rowIndex + 1);
|
|
|
|
await row.click();
|
|
|
|
await this.getDsDetailsModal().waitFor({ state: 'visible' });
|
|
await this.getDsDetailsModal().getByTestId('nc-audit-tab').click();
|
|
|
|
// await row.getByTestId('nc-data-sources-view-audit').click();
|
|
}
|
|
|
|
async openEditConnection({ sourceName }: { sourceName: string }) {
|
|
await this.get().locator('.ds-table-row', { hasText: sourceName }).click();
|
|
|
|
await this.getDsDetailsModal().waitFor({ state: 'visible' });
|
|
await this.getDsDetailsModal().getByTestId('nc-connection-tab').click();
|
|
|
|
await this.getDsDetailsModal().locator('.nc-general-overlay').first().waitFor({ state: 'hidden' });
|
|
}
|
|
|
|
async openAcl({ dataSourceName = defaultBaseName }: { dataSourceName?: string } = {}) {
|
|
await this.get().locator('.ds-table-row', { hasText: dataSourceName }).click();
|
|
|
|
await this.getDsDetailsModal().waitFor({ state: 'visible' });
|
|
await this.getDsDetailsModal().getByTestId('nc-acl-tab').click();
|
|
}
|
|
}
|