mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-29 08:06:50 +00:00
feat(testing): Added quick test, added isEmptyProject option to test setup to have project created with no sakila tables
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { test } from "@playwright/test";
|
||||
import { DashboardPage } from "../pages/Dashboard";
|
||||
import { quickVerify } from "../quickTests/commonTest";
|
||||
import setup from "../setup";
|
||||
|
||||
const apiKey = process.env.E2E_AIRTABLE_API_KEY;
|
||||
@@ -9,45 +10,33 @@ test.describe("Import", () => {
|
||||
let dashboard: DashboardPage;
|
||||
let context: any;
|
||||
|
||||
test.setTimeout(150000);
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
context = await setup({ page });
|
||||
page.setDefaultTimeout(50000);
|
||||
context = await setup({ page, isEmptyProject: true });
|
||||
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,
|
||||
key: apiKey!,
|
||||
baseId: apiBase!,
|
||||
});
|
||||
await dashboard.rootPage.waitForTimeout(1000);
|
||||
await quickVerify({dashboard, airtableImport: true, context});
|
||||
});
|
||||
|
||||
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" });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -39,7 +39,7 @@ test.describe("User roles", () => {
|
||||
let settings: SettingsPage;
|
||||
let context: any;
|
||||
|
||||
test.beforeAll(async ({ page }) => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
context = await setup({ page });
|
||||
dashboard = new DashboardPage(page, context.project);
|
||||
toolbar = dashboard.grid.toolbar;
|
||||
|
||||
@@ -70,7 +70,7 @@ test.describe("Views CRUD Operations", () => {
|
||||
await dashboard.viewSidebar.deleteView({ title: "CityGallery2" });
|
||||
await dashboard.viewSidebar.verifyViewNotPresent({
|
||||
title: "CityGallery2",
|
||||
index: 2,
|
||||
index: 1,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -32,7 +32,7 @@ test.describe("Webhook", () => {
|
||||
let dashboard: DashboardPage, toolbar: ToolbarPage, webhook: WebhookFormPage;
|
||||
let context: any;
|
||||
|
||||
test.beforeAll(async () => {
|
||||
test.beforeEach(async () => {
|
||||
// start a server locally for webhook tests
|
||||
await makeServer();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user