mirror of https://github.com/nocodb/nocodb
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.
39 lines
1.3 KiB
39 lines
1.3 KiB
import BasePage from '../../Base'; |
|
import { ProjectViewPage } from './index'; |
|
import { Locator } from '@playwright/test'; |
|
|
|
export class DataSourcePage extends BasePage { |
|
readonly projectView: ProjectViewPage; |
|
readonly databaseType: Locator; |
|
|
|
constructor(projectView: ProjectViewPage) { |
|
super(projectView.rootPage); |
|
this.projectView = projectView; |
|
this.databaseType = this.get().locator('.nc-extdb-db-type'); |
|
} |
|
|
|
get() { |
|
return this.rootPage.locator('.nc-data-sources-view'); |
|
} |
|
|
|
async getDatabaseTypeList() { |
|
await this.databaseType.click(); |
|
const nodes = await 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 openERD({ rowIndex }: { rowIndex: number }) { |
|
// hardwired |
|
await this.rootPage.locator('button.nc-action-btn').nth(1).click(); |
|
|
|
// const row = this.get().locator('.ds-table-row').nth(rowIndex); |
|
// await row.locator('.ds-table-actions').locator('button.nc-action-btn').waitFor(); |
|
// await row.locator('.ds-table-actions').locator('button.nc-action-btn').nth(1).click(); |
|
} |
|
}
|
|
|