Browse Source

test: switch from modal to drawer for add-row, expand-row

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3343/head
Raju Udava 2 years ago
parent
commit
34689f4c13
  1. 11
      scripts/cypress-v2/integration/common/8a_webhook.js
  2. 18
      scripts/cypress-v2/integration/spec/roleValidation.spec.js

11
scripts/cypress-v2/integration/common/8a_webhook.js

@ -161,12 +161,12 @@ function addNewRow(index, cellValue) {
cy.get(".nc-add-new-row-btn").click();
cy.wait(1000);
cy.get(".nc-expand-col-Title").find(".nc-cell > input").first().type(cellValue);
cy.getActiveModal()
cy.getActiveDrawer()
.find(".ant-btn-primary")
.click();
cy.toastWait("updated successfully");
cy.getActiveModal()
cy.getActiveDrawer()
.find(".ant-btn")
.contains("Cancel")
.click();
@ -184,14 +184,17 @@ function updateRow(index, cellValue) {
.clear()
.type(cellValue);
cy.getActiveModal()
cy.getActiveDrawer()
.find("button")
.contains("Save row")
.click({ force: true });
// partial toast message
cy.toastWait("updated successfully");
cy.get("body").type("{esc}");
cy.getActiveDrawer()
.find("button")
.contains("Cancel")
.click({ force: true });
}
function verifyHookTrigger(count, lastValue) {

18
scripts/cypress-v2/integration/spec/roleValidation.spec.js

@ -120,8 +120,8 @@ export function _editData(roleType, mode) {
.should("exist")
.eq(10)
.click({ force: true });
cy.getActiveModal().find("button").contains("Save row").should("exist");
cy.getActiveModal().find("button").contains("Cancel").should("exist").click();
cy.getActiveDrawer().find("button").contains("Save row").should("exist");
cy.getActiveDrawer().find("button").contains("Cancel").should("exist").click();
} else {
// update cell contents option using row expander should be disabled
//
@ -129,8 +129,8 @@ export function _editData(roleType, mode) {
.should("exist")
.eq(10)
.click({ force: true });
cy.getActiveModal().find("button:disabled").contains("Save row").should("exist");
cy.getActiveModal().find("button").contains("Cancel").should("exist").click();
cy.getActiveDrawer().find("button:disabled").contains("Save row").should("exist");
cy.getActiveDrawer().find("button").contains("Cancel").should("exist").click();
}
// double click cell entries to edit
@ -171,23 +171,23 @@ export function _editComment(roleType, mode) {
cy.wait(3000);
if ("viewer" === roleType) {
cy.getActiveModal()
cy.getActiveDrawer()
.should('exist')
.find(".nc-toggle-comments")
.should("not.exist");
} else {
cy.getActiveModal()
cy.getActiveDrawer()
.should('exist')
.find(".nc-toggle-comments")
.should("exist")
.click();
cy.getActiveModal().find(".nc-comment-box").should('exist').type("Comment-1{enter}");
cy.getActiveDrawer().find(".nc-comment-box").should('exist').type("Comment-1{enter}");
cy.toastWait('Comment added successfully')
cy.getActiveModal().find(".nc-toggle-comments").click();
cy.getActiveDrawer().find(".nc-toggle-comments").click();
}
cy.getActiveModal()
cy.getActiveDrawer()
.find("button")
.contains("Cancel")
.should("exist")

Loading…
Cancel
Save