|
|
@ -7,21 +7,21 @@ let linkText = ""; |
|
|
|
|
|
|
|
|
|
|
|
const generateLinkWithPwd = () => { |
|
|
|
const generateLinkWithPwd = () => { |
|
|
|
mainPage.shareView().click(); |
|
|
|
mainPage.shareView().click(); |
|
|
|
cy.getActiveModal().find(".ant-modal-title").contains("This view is shared via a private link").should("be.visible"); |
|
|
|
cy.getActiveModal(".nc-modal-share-view").find(".ant-modal-title").contains("This view is shared via a private link").should("be.visible"); |
|
|
|
|
|
|
|
|
|
|
|
// enable checkbox & feed pwd, save
|
|
|
|
// enable checkbox & feed pwd, save
|
|
|
|
cy.getActiveModal().find('.ant-collapse').should('exist').click() |
|
|
|
cy.getActiveModal(".nc-modal-share-view").find('.ant-collapse').should('exist').click(); |
|
|
|
cy.getActiveModal().find('.ant-checkbox-input').should('exist').first().then(($el) => { |
|
|
|
cy.getActiveModal(".nc-modal-share-view").find('.ant-checkbox-input').should('exist').first().then(($el) => { |
|
|
|
if (!$el.prop("checked")) { |
|
|
|
if (!$el.prop("checked")) { |
|
|
|
cy.wrap($el).click({ force: true }); |
|
|
|
cy.wrap($el).click({ force: true }); |
|
|
|
cy.getActiveModal().find('input[type="password"]').clear().type("1"); |
|
|
|
cy.getActiveModal(".nc-modal-share-view").find('input[type="password"]').clear().type("1"); |
|
|
|
cy.getActiveModal().find('button:contains("Save password")').click(); |
|
|
|
cy.getActiveModal(".nc-modal-share-view").find('button:contains("Save password")').click(); |
|
|
|
cy.toastWait("Successfully updated"); |
|
|
|
cy.toastWait("Successfully updated"); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// copy link text, visit URL
|
|
|
|
// copy link text, visit URL
|
|
|
|
cy.getActiveModal() |
|
|
|
cy.getActiveModal(".nc-modal-share-view") |
|
|
|
.find(".nc-share-link-box") |
|
|
|
.find(".nc-share-link-box") |
|
|
|
.then(($obj) => { |
|
|
|
.then(($obj) => { |
|
|
|
linkText = $obj.text().trim(); |
|
|
|
linkText = $obj.text().trim(); |
|
|
@ -62,25 +62,25 @@ export const genTest = (apiType, dbType) => { |
|
|
|
baseUrl: null, |
|
|
|
baseUrl: null, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
cy.getActiveModal().should("exist"); |
|
|
|
cy.getActiveModal(".nc-modal-shared-view-password-dlg").should("exist"); |
|
|
|
|
|
|
|
|
|
|
|
// feed password
|
|
|
|
// feed password
|
|
|
|
cy.getActiveModal().find('input[type="password"]').clear().type("a"); |
|
|
|
cy.getActiveModal(".nc-modal-shared-view-password-dlg").find('input[type="password"]').clear().type("a"); |
|
|
|
cy.getActiveModal().find('button:contains("Unlock")').click(); |
|
|
|
cy.getActiveModal(".nc-modal-shared-view-password-dlg").find('button:contains("Unlock")').click(); |
|
|
|
|
|
|
|
|
|
|
|
// if pwd is incorrect, active modal requesting to feed in password again will persist
|
|
|
|
// if pwd is incorrect, active modal requesting to feed in password again will persist
|
|
|
|
cy.getActiveModal().find('button:contains("Unlock")').should('exist'); |
|
|
|
cy.getActiveModal(".nc-modal-shared-view-password-dlg").find('button:contains("Unlock")').should('exist'); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// fallover test- use previously opened view & continue verification instead of opening again
|
|
|
|
// fallover test- use previously opened view & continue verification instead of opening again
|
|
|
|
it("Share view with correct password", () => { |
|
|
|
it("Share view with correct password", () => { |
|
|
|
|
|
|
|
|
|
|
|
// feed password
|
|
|
|
// feed password
|
|
|
|
cy.getActiveModal() |
|
|
|
cy.getActiveModal(".nc-modal-shared-view-password-dlg") |
|
|
|
.find('input[type="password"]') |
|
|
|
.find('input[type="password"]') |
|
|
|
.clear() |
|
|
|
.clear() |
|
|
|
.type("1"); |
|
|
|
.type("1"); |
|
|
|
cy.getActiveModal().find('button:contains("Unlock")').click(); |
|
|
|
cy.getActiveModal(".nc-modal-shared-view-password-dlg").find('button:contains("Unlock")').click(); |
|
|
|
|
|
|
|
|
|
|
|
// if pwd is incorrect, active modal requesting to feed in password again will persist
|
|
|
|
// if pwd is incorrect, active modal requesting to feed in password again will persist
|
|
|
|
// cy.getActiveModal().find('button:contains("Unlock")').should('not.exist');
|
|
|
|
// cy.getActiveModal().find('button:contains("Unlock")').should('not.exist');
|
|
|
|