多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

40 lines
1.4 KiB

import { SettingsPage } from '.';
import { defaultBaseName } from '../../../constants';
import BasePage from '../../Base';
import { AclPage } from './Acl';
import { SettingsErdPage } from './Erd';
import { MetaDataPage } from './Metadata';
export class DataSourcesPage extends BasePage {
private readonly settings: SettingsPage;
readonly erd: SettingsErdPage;
readonly acl: AclPage;
readonly metaData: MetaDataPage;
constructor(settings: SettingsPage) {
super(settings.rootPage);
this.settings = settings;
this.erd = new SettingsErdPage(this);
this.acl = new AclPage(this);
this.metaData = new MetaDataPage(this);
}
get() {
return this.settings.get().locator(`[data-testid="nc-settings-subtab-Data Sources"]`);
}
async openErd({ dataSourceName }: { dataSourceName: string }) {
await this.get().locator('.ds-table-row', { hasText: dataSourceName }).locator('button:has-text("ERD")').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();
}
}