Browse Source

test: fix iFrame cell validation

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3655/head
Raju Udava 2 years ago
parent
commit
1daba9050b
  1. 41
      scripts/cypress/integration/common/6g_base_share.js

41
scripts/cypress/integration/common/6g_base_share.js

@ -10,7 +10,7 @@ import {
_viewMenu, _viewMenu,
_topRightMenu, _topRightMenu,
} from "../spec/roleValidation.spec"; } from "../spec/roleValidation.spec";
import {linkSync} from "fs"; import { linkSync } from "fs";
// fix me // fix me
let linkText = ""; let linkText = "";
@ -65,15 +65,15 @@ export const genTest = (apiType, dbType) => {
beforeEach(() => { beforeEach(() => {
cy.restoreLocalStorage(); cy.restoreLocalStorage();
}) });
afterEach(() => { afterEach(() => {
cy.saveLocalStorage(); cy.saveLocalStorage();
}) });
it(`Generate base share URL`, () => { it(`Generate base share URL`, () => {
// click SHARE // click SHARE
cy.get(".nc-share-base:visible").should('exist').click(); cy.get(".nc-share-base:visible").should("exist").click();
// Click on readonly base text // Click on readonly base text
cy.getActiveModal().find(".nc-disable-shared-base").click(); cy.getActiveModal().find(".nc-disable-shared-base").click();
@ -85,8 +85,8 @@ export const genTest = (apiType, dbType) => {
cy.getActiveModal().find(".nc-shared-base-role").click(); cy.getActiveModal().find(".nc-shared-base-role").click();
cy.getActiveSelection('.nc-dropdown-share-base-role') cy.getActiveSelection(".nc-dropdown-share-base-role")
.find('.ant-select-item') .find(".ant-select-item")
.eq(1) .eq(1)
.click(); .click();
@ -130,12 +130,12 @@ style="background: transparent; "></iframe>
loginPage.loginAndOpenProject(apiType, dbType); loginPage.loginAndOpenProject(apiType, dbType);
// click SHARE // click SHARE
cy.get(".nc-share-base:visible").should('exist').click(); cy.get(".nc-share-base:visible").should("exist").click();
cy.getActiveModal().find(".nc-shared-base-role").click(); cy.getActiveModal().find(".nc-shared-base-role").click();
cy.getActiveSelection('.nc-dropdown-share-base-role') cy.getActiveSelection(".nc-dropdown-share-base-role")
.find('.ant-select-item') .find(".ant-select-item")
.eq(0) .eq(0)
.click(); .click();
@ -147,19 +147,20 @@ style="background: transparent; "></iframe>
describe(`${apiType.toUpperCase()} iFrame Test`, () => { describe(`${apiType.toUpperCase()} iFrame Test`, () => {
// https://docs.cypress.io/api/commands/visit#Prefixes // https://docs.cypress.io/api/commands/visit#Prefixes
it("Generate & verify embed HTML IFrame", {baseUrl: null}, () => { it("Generate & verify embed HTML IFrame", { baseUrl: null }, () => {
let filePath = "scripts/cypress/fixtures/sampleFiles/iFrame.html"; let filePath = "scripts/cypress/fixtures/sampleFiles/iFrame.html";
cy.log(filePath); cy.log(filePath);
cy.visit(filePath, {baseUrl: null}); cy.visit(filePath, { baseUrl: null });
// wait for iFrame to load // wait for iFrame to load
cy.frameLoaded(".nc-embed"); cy.frameLoaded(".nc-embed");
// cy.openTableTab("Country", 25); // cy.openTableTab("Country", 25);
cy.iframe().find(`.nc-project-tree-tbl-Actor`, {timeout: 10000}).should("exist") cy.iframe()
.find(`.nc-project-tree-tbl-Actor`, { timeout: 10000 })
.should("exist")
.first() .first()
.click({force: true}); .click({ force: true });
// validation for base menu opitons // validation for base menu opitons
cy.iframe().find(".nc-project-tree").should("exist"); cy.iframe().find(".nc-project-tree").should("exist");
@ -169,11 +170,15 @@ style="background: transparent; "></iframe>
cy.iframe().find(".nc-actions-menu-btn").should("exist"); cy.iframe().find(".nc-actions-menu-btn").should("exist");
// validate data (row-1) // validate data (row-1)
cy.iframe().find(`.nc-grid-cell`).eq(1).contains("PENELOPE").should("exist"); cy.iframe()
cy.iframe().find(`.nc-grid-cell`).eq(2).contains("GUINESS").should("exist"); .find(`.nc-grid-cell:eq(1):contains("PENELOPE")`)
.should("exist");
cy.iframe()
.find(`.nc-grid-cell:eq(2):contains("GUINESS")`)
.should("exist");
});
}); });
}) };
}
/** /**
* @copyright Copyright (c) 2021, Xgene Cloud Ltd * @copyright Copyright (c) 2021, Xgene Cloud Ltd

Loading…
Cancel
Save