From 13eb3408381c3c9ff2f3ee4ba9517fb09edafad6 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Tue, 30 Aug 2022 15:32:38 +0530 Subject: [PATCH] test: CY share base handling Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../integration/common/6g_base_share.js | 78 ++++++++----------- 1 file changed, 33 insertions(+), 45 deletions(-) diff --git a/scripts/cypress-v2/integration/common/6g_base_share.js b/scripts/cypress-v2/integration/common/6g_base_share.js index 22979dd7a0..a741841988 100644 --- a/scripts/cypress-v2/integration/common/6g_base_share.js +++ b/scripts/cypress-v2/integration/common/6g_base_share.js @@ -10,6 +10,7 @@ import { _viewMenu, _topRightMenu, } from "../spec/roleValidation.spec"; +import {linkSync} from "fs"; // fix me let linkText = ""; @@ -26,51 +27,36 @@ export const genTest = (apiType, dbType) => { baseUrl: null, }); cy.wait(5000); - - cy.saveLocalStorage(); - cy.wait(1000); - cy.printLocalStorage(); - }); + }); it(`${roleType}: Validate access permissions: advance menu`, () => { - cy.restoreLocalStorage(); + // cy.restoreLocalStorage(); _advSettings(roleType, "baseShare"); }); it(`${roleType}: Validate access permissions: edit schema`, () => { - cy.restoreLocalStorage(); + // cy.restoreLocalStorage(); _editSchema(roleType, "baseShare"); }); it(`${roleType}: Validate access permissions: edit data`, () => { - cy.restoreLocalStorage(); + // cy.restoreLocalStorage(); _editData(roleType, "baseShare"); }); it(`${roleType}: Validate access permissions: edit comments`, () => { - cy.restoreLocalStorage(); + // cy.restoreLocalStorage(); _editComment(roleType, "baseShare"); }); - // fix me - // it(`${roleType}: Validate access permissions: view's menu`, () => { - // cy.restoreLocalStorage(); - // _viewMenu(roleType, "baseShare"); - // }); + it(`${roleType}: Validate access permissions: view's menu`, () => { + // cy.restoreLocalStorage(); + _viewMenu(roleType, "baseShare"); + }); }; describe(`${apiType.toUpperCase()} Base VIEW share`, () => { before(() => { - - // cy.restoreLocalStorage(); - // cy.wait(1000); - // - // cy.visit("/"); - // cy.wait(5000); - // - // // // kludge: wait for page load to finish - // projectsPage.openConfiguredProject(apiType, dbType); - loginPage.loginAndOpenProject(apiType, dbType); cy.openTableTab("Country", 25); @@ -164,35 +150,37 @@ style="background: transparent; "> }); permissionValidation("editor"); + }); + describe(`${apiType.toUpperCase()} iFrame Test`, () => { // https://docs.cypress.io/api/commands/visit#Prefixes - it.skip("Generate & verify embed HTML IFrame", {baseUrl: null}, () => { + it("Generate & verify embed HTML IFrame", {baseUrl: null}, () => { - let filePath = "scripts/cypress-v2/fixtures/sampleFiles/iFrame.html"; - cy.log(filePath); - cy.visit(filePath, {baseUrl: null}); + let filePath = "scripts/cypress-v2/fixtures/sampleFiles/iFrame.html"; + cy.log(filePath); + cy.visit(filePath, {baseUrl: null}); - // wait for iFrame to load - cy.frameLoaded(".nc-embed"); + // wait for iFrame to load + cy.frameLoaded(".nc-embed"); - // cy.openTableTab("Country", 25); - cy.iframe().find(`.nc-project-tree-tbl-Actor`, {timeout: 10000}).should("exist") - .first() - .click({force: true}); + // cy.openTableTab("Country", 25); + cy.iframe().find(`.nc-project-tree-tbl-Actor`, {timeout: 10000}).should("exist") + .first() + .click({force: true}); - // validation for base menu opitons - cy.iframe().find(".nc-project-tree").should("exist"); - cy.iframe().find(".nc-fields-menu-btn").should("exist"); - cy.iframe().find(".nc-sort-menu-btn").should("exist"); - cy.iframe().find(".nc-filter-menu-btn").should("exist"); - cy.iframe().find(".nc-actions-menu-btn").should("exist"); + // validation for base menu opitons + cy.iframe().find(".nc-project-tree").should("exist"); + cy.iframe().find(".nc-fields-menu-btn").should("exist"); + cy.iframe().find(".nc-sort-menu-btn").should("exist"); + cy.iframe().find(".nc-filter-menu-btn").should("exist"); + cy.iframe().find(".nc-actions-menu-btn").should("exist"); - // validate data (row-1) - cy.iframe().find(`.nc-grid-cell`).eq(1).contains("PENELOPE").should("exist"); - cy.iframe().find(`.nc-grid-cell`).eq(2).contains("GUINESS").should("exist"); + // validate data (row-1) + cy.iframe().find(`.nc-grid-cell`).eq(1).contains("PENELOPE").should("exist"); + cy.iframe().find(`.nc-grid-cell`).eq(2).contains("GUINESS").should("exist"); - }); - }); + }); + }) } /**