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.
32 lines
1.0 KiB
32 lines
1.0 KiB
2 years ago
|
import { Locator } from '@playwright/test';
|
||
2 years ago
|
import BasePage from '../../Base';
|
||
|
import { DashboardPage } from '..';
|
||
2 years ago
|
|
||
|
export class ImportAirtablePage extends BasePage {
|
||
|
readonly dashboard: DashboardPage;
|
||
|
readonly importButton: Locator;
|
||
|
|
||
|
constructor(dashboard: DashboardPage) {
|
||
|
super(dashboard.rootPage);
|
||
|
this.dashboard = dashboard;
|
||
2 years ago
|
this.importButton = dashboard.get().locator('.nc-btn-airtable-import');
|
||
2 years ago
|
}
|
||
|
|
||
|
get() {
|
||
|
return this.dashboard.get().locator(`.nc-modal-airtable-import`);
|
||
|
}
|
||
|
|
||
|
async import({ key, baseId }: { key: string; baseId: string }) {
|
||
2 years ago
|
// kludge: failing in headless mode
|
||
|
// additional time to allow the modal to render completely
|
||
|
await this.rootPage.waitForTimeout(1000);
|
||
|
|
||
2 years ago
|
await this.get().locator(`.nc-input-api-key >> input`).fill(key);
|
||
|
await this.get().locator(`.nc-input-shared-base`).fill(baseId);
|
||
|
await this.importButton.click();
|
||
|
|
||
|
await this.get().locator(`button:has-text("Go to Dashboard")`).waitFor();
|
||
|
await this.get().locator(`button:has-text("Go to Dashboard")`).click();
|
||
|
}
|
||
|
}
|