mirror of https://github.com/nocodb/nocodb
Raju Udava
2 years ago
committed by
Muhammed Mustafa
3 changed files with 162 additions and 70 deletions
@ -1,46 +1,76 @@ |
|||||||
import { test } from '@playwright/test'; |
import { test } from "@playwright/test"; |
||||||
import { DashboardPage } from '../pages/Dashboard'; |
import { DashboardPage } from "../pages/Dashboard"; |
||||||
import setup from '../setup'; |
import setup from "../setup"; |
||||||
|
|
||||||
|
test.describe("Views CRUD Operations", () => { |
||||||
// todo: Enable when view bug is fixed
|
|
||||||
test.describe.skip('Views', () => { |
|
||||||
let dashboard: DashboardPage; |
let dashboard: DashboardPage; |
||||||
let context: any; |
let context: any; |
||||||
|
|
||||||
test.beforeEach(async ({page}) => { |
test.beforeEach(async ({ page }) => { |
||||||
context = await setup({ page }); |
context = await setup({ page }); |
||||||
dashboard = new DashboardPage(page, context.project); |
dashboard = new DashboardPage(page, context.project); |
||||||
}) |
}); |
||||||
|
|
||||||
test('Create views, reorder and delete', async () => { |
|
||||||
await dashboard.treeView.openTable({title: "City"}); |
|
||||||
|
|
||||||
await dashboard.viewSidebar.createGridView({title: "CityGrid"}); |
|
||||||
await dashboard.viewSidebar.verifyView({title: "CityGrid", index: 1}); |
|
||||||
|
|
||||||
await dashboard.viewSidebar.createFormView({title: "CityForm"}); |
test("Create views, reorder and delete", async () => { |
||||||
await dashboard.viewSidebar.verifyView({title: "CityForm", index: 2}); |
await dashboard.treeView.openTable({ title: "City" }); |
||||||
|
await dashboard.viewSidebar.createGridView({ title: "CityGrid" }); |
||||||
|
await dashboard.viewSidebar.verifyView({ title: "CityGrid", index: 1 }); |
||||||
|
await dashboard.viewSidebar.renameView({ |
||||||
|
title: "CityGrid", |
||||||
|
newTitle: "CityGrid2", |
||||||
|
}); |
||||||
|
await dashboard.viewSidebar.verifyView({ |
||||||
|
title: "CityGrid2", |
||||||
|
index: 1, |
||||||
|
}); |
||||||
|
|
||||||
await dashboard.viewSidebar.createGalleryView({title: "CityGallery"}); |
await dashboard.viewSidebar.createFormView({ title: "CityForm" }); |
||||||
await dashboard.viewSidebar.verifyView({title: "CityGallery", index: 3}); |
await dashboard.viewSidebar.verifyView({ title: "CityForm", index: 2 }); |
||||||
|
await dashboard.viewSidebar.renameView({ |
||||||
|
title: "CityForm", |
||||||
|
newTitle: "CityForm2", |
||||||
|
}); |
||||||
|
await dashboard.viewSidebar.verifyView({ |
||||||
|
title: "CityForm2", |
||||||
|
index: 2, |
||||||
|
}); |
||||||
|
|
||||||
await dashboard.viewSidebar.reorderViews({ |
await dashboard.viewSidebar.createGalleryView({ title: "CityGallery" }); |
||||||
sourceView: "CityGrid", |
await dashboard.viewSidebar.verifyView({ title: "CityGallery", index: 3 }); |
||||||
destinationView: "CityForm" |
await dashboard.viewSidebar.renameView({ |
||||||
|
title: "CityGallery", |
||||||
|
newTitle: "CityGallery2", |
||||||
|
}); |
||||||
|
await dashboard.viewSidebar.verifyView({ |
||||||
|
title: "CityGallery2", |
||||||
|
index: 3, |
||||||
}); |
}); |
||||||
await dashboard.viewSidebar.verifyView({title: "CityGrid", index: 2}); |
|
||||||
await dashboard.viewSidebar.verifyView({title: "CityForm", index: 1}); |
|
||||||
|
|
||||||
await dashboard.viewSidebar.deleteView({title: "CityForm"}); |
// todo: Enable when view bug is fixed
|
||||||
await dashboard.viewSidebar.verifyViewNotPresent({title: "CityForm", index: 1}); |
// await dashboard.viewSidebar.reorderViews({
|
||||||
|
// sourceView: "CityGrid",
|
||||||
|
// destinationView: "CityForm",
|
||||||
|
// });
|
||||||
|
// await dashboard.viewSidebar.verifyView({ title: "CityGrid", index: 2 });
|
||||||
|
// await dashboard.viewSidebar.verifyView({ title: "CityForm", index: 1 });
|
||||||
|
|
||||||
// todo: Delete form view is deleting grid view. Probably a bug.
|
// await dashboard.viewSidebar.deleteView({ title: "CityForm2" });
|
||||||
// await dashboard.viewSidebar.deleteView({title: "CityGrid"});
|
// await dashboard.viewSidebar.verifyViewNotPresent({
|
||||||
// await dashboard.viewSidebar.verifyViewNotPresent({title: "CityGrid", index: 1});
|
// title: "CityGrid2",
|
||||||
|
// index: 2,
|
||||||
|
// });
|
||||||
|
|
||||||
await dashboard.viewSidebar.deleteView({title: "CityGallery"}); |
await dashboard.viewSidebar.deleteView({ title: "CityForm2" }); |
||||||
await dashboard.viewSidebar.verifyViewNotPresent({title: "CityGallery", index: 1}); |
await dashboard.viewSidebar.verifyViewNotPresent({ |
||||||
|
title: "CityForm2", |
||||||
|
index: 2, |
||||||
}); |
}); |
||||||
|
|
||||||
|
// fix index after enabling reorder test
|
||||||
|
await dashboard.viewSidebar.deleteView({ title: "CityGallery2" }); |
||||||
|
await dashboard.viewSidebar.verifyViewNotPresent({ |
||||||
|
title: "CityGallery2", |
||||||
|
index: 2, |
||||||
|
}); |
||||||
|
}); |
||||||
}); |
}); |
||||||
|
Loading…
Reference in new issue