feat(testing): Added some test for attachment column, moved cell into common folder and added filepicker support

This commit is contained in:
Muhammed Mustafa
2022-10-21 12:35:42 +05:30
parent b908970b7c
commit 865e6e3904
18 changed files with 156 additions and 11 deletions

View 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();
});
});