Browse Source

cypress: revise password checkbox logic

pull/2552/head
Wing-Kam Wong 2 years ago
parent
commit
ec16b56ca7
  1. 19
      scripts/cypress/integration/common/4b_table_view_share.js

19
scripts/cypress/integration/common/4b_table_view_share.js

@ -17,15 +17,16 @@ const generateLinkWithPwd = () => {
// enable checkbox & feed pwd, save
cy.getActiveModal().find('button:contains("More Options")').click({ force: true });
const passwordCheckbox = cy.getActiveModal().find('[role="checkbox"][type="checkbox"]').first()
if (passwordCheckbox.eq(0)) {
passwordCheckbox.click({ force: true });
cy.getActiveModal().find('input[type="password"]').type("1");
cy.snipActiveModal("Modal_ShareView_Password");
cy.getActiveModal().find('button:contains("Save password")').click();
cy.toastWait("Successfully updated");
}
cy.getActiveModal().find('[role="checkbox"][type="checkbox"]').first().then(($el) => {
if (!$el.prop("checked")) {
cy.wrap($el).click({ force: true });
cy.getActiveModal().find('input[type="password"]').type("1");
cy.snipActiveModal("Modal_ShareView_Password");
cy.getActiveModal().find('button:contains("Save password")').click();
cy.toastWait("Successfully updated");
}
});
// copy link text, visit URL
cy.getActiveModal()
.find(".share-link-box")

Loading…
Cancel
Save