|
|
|
@ -11,82 +11,90 @@ test.describe("Expanded form URL", () => {
|
|
|
|
|
dashboard = new DashboardPage(page, context.project); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test("Grid", async () => { |
|
|
|
|
// close 'Team & Auth' tab
|
|
|
|
|
await dashboard.closeTab({ title: "Team & Auth" }); |
|
|
|
|
await dashboard.treeView.openTable({ title: "Country" }); |
|
|
|
|
function viewTest(viewType: string) { |
|
|
|
|
test(viewType, async () => { |
|
|
|
|
// close 'Team & Auth' tab
|
|
|
|
|
await dashboard.closeTab({ title: "Team & Auth" }); |
|
|
|
|
await dashboard.treeView.openTable({ title: "Country" }); |
|
|
|
|
|
|
|
|
|
await dashboard.viewSidebar.createGridView({ title: "CountryGrid" }); |
|
|
|
|
let viewObj; |
|
|
|
|
if (viewType === "grid") { |
|
|
|
|
viewObj = dashboard.grid; |
|
|
|
|
} else if (viewType === "gallery") { |
|
|
|
|
viewObj = dashboard.gallery; |
|
|
|
|
await viewObj.fields({ title: "City List" }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// expand row & verify URL
|
|
|
|
|
await dashboard.grid.openExpandedRow({ index: 0 }); |
|
|
|
|
await dashboard.expandedForm.verify({ |
|
|
|
|
header: "Afghanistan", |
|
|
|
|
url: "rowId=1", |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// // verify copied URL in clipboard
|
|
|
|
|
// await dashboard.expandedForm.copyUrlButton.click();
|
|
|
|
|
// const expandedFormUrl = await dashboard.expandedForm.getClipboardText();
|
|
|
|
|
// expect(expandedFormUrl).toContain("rowId=1");
|
|
|
|
|
if (viewType === "grid") { |
|
|
|
|
await dashboard.viewSidebar.createGridView({ title: "CountryExpand" }); |
|
|
|
|
} else if (viewType === "gallery") { |
|
|
|
|
await dashboard.viewSidebar.createGalleryView({ |
|
|
|
|
title: "CountryExpand", |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// access a new rowID using URL
|
|
|
|
|
let url = await dashboard.rootPage.url(); |
|
|
|
|
await dashboard.expandedForm.close(); |
|
|
|
|
await dashboard.rootPage.goto( |
|
|
|
|
"/" + url.split("/").slice(3).join("/").split("?")[0] + "?rowId=2" |
|
|
|
|
); |
|
|
|
|
await dashboard.expandedForm.verify({ |
|
|
|
|
header: "Algeria", |
|
|
|
|
url: "rowId=2", |
|
|
|
|
}); |
|
|
|
|
await dashboard.expandedForm.close(); |
|
|
|
|
// expand row & verify URL
|
|
|
|
|
await viewObj.openExpandedRow({ index: 0 }); |
|
|
|
|
await dashboard.expandedForm.verify({ |
|
|
|
|
header: "Afghanistan", |
|
|
|
|
url: "rowId=1", |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// visit invalid rowID
|
|
|
|
|
await dashboard.rootPage.goto( |
|
|
|
|
"/" + url.split("/").slice(3).join("/").split("?")[0] + "?rowId=999" |
|
|
|
|
); |
|
|
|
|
await dashboard.toastWait({ message: "Record not found" }); |
|
|
|
|
// ensure grid is displayed after invalid URL access
|
|
|
|
|
await dashboard.grid.verifyRowCount({ count: 25 }); |
|
|
|
|
// // verify copied URL in clipboard
|
|
|
|
|
// await dashboard.expandedForm.copyUrlButton.click();
|
|
|
|
|
// const expandedFormUrl = await dashboard.expandedForm.getClipboardText();
|
|
|
|
|
// expect(expandedFormUrl).toContain("rowId=1");
|
|
|
|
|
|
|
|
|
|
// Nested URL
|
|
|
|
|
await dashboard.rootPage.goto( |
|
|
|
|
"/" + url.split("/").slice(3).join("/").split("?")[0] + "?rowId=1" |
|
|
|
|
); |
|
|
|
|
await dashboard.expandedForm.verify({ |
|
|
|
|
header: "Afghanistan", |
|
|
|
|
url: "rowId=1", |
|
|
|
|
}); |
|
|
|
|
await dashboard.expandedForm.openChildCard({ |
|
|
|
|
column: "City List", |
|
|
|
|
title: "Kabul", |
|
|
|
|
}); |
|
|
|
|
await dashboard.rootPage.waitForTimeout(1000); |
|
|
|
|
await dashboard.expandedForm.verify({ |
|
|
|
|
header: "Kabul", |
|
|
|
|
url: "rowId=1", |
|
|
|
|
}); |
|
|
|
|
let expandFormCount = await dashboard.expandedForm.count(); |
|
|
|
|
expect(expandFormCount).toBe(2); |
|
|
|
|
// access a new rowID using URL
|
|
|
|
|
let url = await dashboard.rootPage.url(); |
|
|
|
|
await dashboard.expandedForm.close(); |
|
|
|
|
await dashboard.rootPage.goto( |
|
|
|
|
"/" + url.split("/").slice(3).join("/").split("?")[0] + "?rowId=2" |
|
|
|
|
); |
|
|
|
|
await dashboard.expandedForm.verify({ |
|
|
|
|
header: "Algeria", |
|
|
|
|
url: "rowId=2", |
|
|
|
|
}); |
|
|
|
|
await dashboard.expandedForm.close(); |
|
|
|
|
|
|
|
|
|
// close child card
|
|
|
|
|
await dashboard.expandedForm.cancel(); |
|
|
|
|
await dashboard.expandedForm.verify({ |
|
|
|
|
header: "Afghanistan", |
|
|
|
|
url: "rowId=1", |
|
|
|
|
}); |
|
|
|
|
await dashboard.expandedForm.cancel(); |
|
|
|
|
}); |
|
|
|
|
// visit invalid rowID
|
|
|
|
|
await dashboard.rootPage.goto( |
|
|
|
|
"/" + url.split("/").slice(3).join("/").split("?")[0] + "?rowId=999" |
|
|
|
|
); |
|
|
|
|
await dashboard.toastWait({ message: "Record not found" }); |
|
|
|
|
// ensure grid is displayed after invalid URL access
|
|
|
|
|
await viewObj.verifyRowCount({ count: 25 }); |
|
|
|
|
|
|
|
|
|
test.skip("Gallery", async () => { |
|
|
|
|
// close 'Team & Auth' tab
|
|
|
|
|
await dashboard.closeTab({ title: "Team & Auth" }); |
|
|
|
|
await dashboard.treeView.openTable({ title: "Country" }); |
|
|
|
|
// Nested URL
|
|
|
|
|
await dashboard.rootPage.goto( |
|
|
|
|
"/" + url.split("/").slice(3).join("/").split("?")[0] + "?rowId=1" |
|
|
|
|
); |
|
|
|
|
await dashboard.expandedForm.verify({ |
|
|
|
|
header: "Afghanistan", |
|
|
|
|
url: "rowId=1", |
|
|
|
|
}); |
|
|
|
|
await dashboard.expandedForm.openChildCard({ |
|
|
|
|
column: "City List", |
|
|
|
|
title: "Kabul", |
|
|
|
|
}); |
|
|
|
|
await dashboard.rootPage.waitForTimeout(1000); |
|
|
|
|
await dashboard.expandedForm.verify({ |
|
|
|
|
header: "Kabul", |
|
|
|
|
url: "rowId=1", |
|
|
|
|
}); |
|
|
|
|
let expandFormCount = await dashboard.expandedForm.count(); |
|
|
|
|
expect(expandFormCount).toBe(2); |
|
|
|
|
|
|
|
|
|
await dashboard.viewSidebar.createGalleryView({ title: "CountryGallery" }); |
|
|
|
|
await dashboard.grid.toolbar.fields.toggle({ title: "City List" }); |
|
|
|
|
// close child card
|
|
|
|
|
await dashboard.expandedForm.cancel(); |
|
|
|
|
await dashboard.expandedForm.verify({ |
|
|
|
|
header: "Afghanistan", |
|
|
|
|
url: "rowId=1", |
|
|
|
|
}); |
|
|
|
|
await dashboard.expandedForm.cancel(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// expand row & verify URL
|
|
|
|
|
}); |
|
|
|
|
viewTest("grid"); |
|
|
|
|
// viewTest("gallery");
|
|
|
|
|
}); |
|
|
|
|