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. 33
      scripts/cypress/integration/common/6g_base_share.js

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

@ -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();
@ -148,7 +148,6 @@ 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 });
@ -157,7 +156,9 @@ style="background: transparent; "></iframe>
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 });
@ -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