test: import airtable

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
This commit is contained in:
Raju Udava
2022-10-20 21:52:53 +05:30
committed by Muhammed Mustafa
parent 31917d23ab
commit d342a74dc4
4 changed files with 159 additions and 13 deletions

View File

@@ -0,0 +1,53 @@
import { test } from "@playwright/test";
import { DashboardPage } from "../pages/Dashboard";
import setup from "../setup";
const apiKey = process.env.E2E_AIRTABLE_API_KEY;
const apiBase = process.env.E2E_AIRTABLE_BASE_ID;
test.describe("Import", () => {
let dashboard: DashboardPage;
let context: any;
test.beforeEach(async ({ page }) => {
context = await setup({ page });
dashboard = new DashboardPage(page, context.project);
});
test("Airtable", async () => {
// create empty project
await dashboard.clickHome();
await dashboard.createProject({ name: "airtable", type: "xcdb" });
await dashboard.treeView.quickImport({ title: "Airtable" });
await dashboard.importAirtable.import({
key: apiKey,
baseId: apiBase,
});
await dashboard.rootPage.waitForTimeout(1000);
});
test("Excel", async () => {
// create empty project
await dashboard.clickHome();
await dashboard.createProject({ name: "excel", type: "xcdb" });
await dashboard.treeView.quickImport({ title: "Microsoft Excel" });
});
test("CSV", async () => {
// create empty project
await dashboard.clickHome();
await dashboard.createProject({ name: "CSV", type: "xcdb" });
await dashboard.treeView.quickImport({ title: "CSV file" });
});
test("JSON", async () => {
// create empty project
await dashboard.clickHome();
await dashboard.createProject({ name: "JSON", type: "xcdb" });
await dashboard.treeView.quickImport({ title: "JSON file" });
});
});