|
|
|
@ -2,12 +2,14 @@ import { isTestSuiteActive, roles } from "../../support/page_objects/projectCons
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const newPassword = `${roles.owner.credentials.password}1`; |
|
|
|
|
const currentPasswordIsWrong = "Current password is wrong"; |
|
|
|
|
const passwordsNotMatching = "Passwords do not match"; |
|
|
|
|
|
|
|
|
|
export const genTest = (apiType, dbType) => { |
|
|
|
|
if (!isTestSuiteActive(apiType, dbType)) return; |
|
|
|
|
|
|
|
|
|
describe('User settings test', () => { |
|
|
|
|
it('Visit user settings', () => { |
|
|
|
|
describe('User settings', () => { |
|
|
|
|
it('Visit user settings page', () => { |
|
|
|
|
cy.get("[data-cy='nc-noco-brand-icon']").click(); |
|
|
|
|
|
|
|
|
|
cy.get("[data-cy='nc-menu-accounts']").click(); |
|
|
|
@ -16,7 +18,7 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
cy.get("[data-cy='nc-user-settings-form']").should("exist"); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe('Change password', () => { |
|
|
|
|
describe('Update password and verify user settings form validation', () => { |
|
|
|
|
beforeEach(() => { |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__current-password']").clear(); |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__new-password']").clear(); |
|
|
|
@ -28,29 +30,34 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__new-password']").type(newPassword); |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__new-password-repeat']").type(newPassword); |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__submit']").click(); |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__error']").should("exist").should("contain", "Current password is wrong"); |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__error']").should("exist").should("contain", currentPasswordIsWrong); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('Verifies matching passwords', () => { |
|
|
|
|
it('Verifies passwords match', () => { |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__current-password']").type(roles.owner.credentials.password); |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__new-password']").type(newPassword); |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__new-password-repeat']").type(newPassword + 'NotMatching'); |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__new-password-repeat']").type(`${newPassword}NotMatching`); |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__submit']").click(); |
|
|
|
|
cy.get(".ant-form-item-explain-error").should("exist").should("contain", "Passwords do not match"); |
|
|
|
|
cy.get(".ant-form-item-explain-error").should("exist").should("contain", passwordsNotMatching); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('Change user password using valid password', () => { |
|
|
|
|
it('Changes user password & signs out', () => { |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__current-password']").type(roles.owner.credentials.password); |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__new-password']").type(newPassword); |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__new-password-repeat']").type(newPassword); |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__submit']").click(); |
|
|
|
|
cy.get("[data-cy='nc-user-settings-form__submit']").should("not.exist"); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
describe('Sign in with new password', () => { |
|
|
|
|
it('Verifies new password works', () => { |
|
|
|
|
cy.get("[data-cy='nc-form-signin']").should("exist"); |
|
|
|
|
cy.get("[data-cy='nc-form-signin__email']").type(roles.owner.credentials.username); |
|
|
|
|
cy.get("[data-cy='nc-form-signin__password']").type(newPassword); |
|
|
|
|
cy.get("[data-cy='nc-form-signin__submit']").click(); |
|
|
|
|
cy.get("[data-cy='nc-menu-accounts']").should("exist"); |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|