mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-30 17:26:53 +00:00
feat(testing): Added some test for attachment column, moved cell into common folder and added filepicker support
This commit is contained in:
39
scripts/playwright/tests/attachments.spec.ts
Normal file
39
scripts/playwright/tests/attachments.spec.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { test } from "@playwright/test";
|
||||
import { DashboardPage } from "../pages/Dashboard";
|
||||
import { SharedFormPage } from "../pages/SharedForm";
|
||||
import setup from "../setup";
|
||||
|
||||
test.describe("Attachment column", () => {
|
||||
let dashboard: DashboardPage;
|
||||
let context: any;
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
context = await setup({ page });
|
||||
dashboard = new DashboardPage(page, context.project);
|
||||
});
|
||||
|
||||
test("Create duration column", async ({page, context}) => {
|
||||
await dashboard.treeView.openTable({title: "Country"});
|
||||
await dashboard.grid.column.create({
|
||||
title: "testAttach",
|
||||
type: "Attachment",
|
||||
})
|
||||
for (let i = 4; i <= 6; i++) {
|
||||
const filepath = `${process.cwd()}/fixtures/sampleFiles/${i}.json`;
|
||||
await dashboard.grid.cell.attachment.addFile({index: i, columnHeader: "testAttach", filePath: filepath});
|
||||
await dashboard.grid.cell.attachment.verifyFile({index: i, columnHeader: "testAttach"});
|
||||
}
|
||||
|
||||
await dashboard.viewSidebar.createFormView({
|
||||
title: "Form 1",
|
||||
});
|
||||
await dashboard.form.toolbar.clickShareView();
|
||||
const sharedFormUrl = await dashboard.form.toolbar.shareView.getShareLink();
|
||||
const newPage = await context.newPage()
|
||||
await newPage.goto(sharedFormUrl);
|
||||
|
||||
const sharedForm = new SharedFormPage(newPage);
|
||||
await sharedForm.cell.attachment.addFile({columnHeader: 'testAttach', filePath: `${process.cwd()}/fixtures/sampleFiles/1.json`});
|
||||
await sharedForm.submit();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user