diff --git a/client/cypress.env.example.json b/client/cypress.env.example.json index 4e35396db58c23c75eb78b002819fb4fb30a4789..f6bea189cc02f0d50060317eb639643621ff49c7 100644 --- a/client/cypress.env.example.json +++ b/client/cypress.env.example.json @@ -2,5 +2,6 @@ "CLIENT_URL": "http://localhost:3000", "SERVER_URL": "http://localhost:5000", "TEST_USERNAME": "your-test-user", - "TEST_USER_PASSWORD": "your-test-password" + "TEST_USER_PASSWORD": "your-test-password", + "USED_USERNAME": "your-used-username" } diff --git a/client/cypress/e2e/register/register.cy.ts b/client/cypress/e2e/register/register.cy.ts index 6d77311fd4f7c4f0c36657863a9d0a0116898ce0..3236e0abd54cb4d518cc2a795e55de94e36cca24 100644 --- a/client/cypress/e2e/register/register.cy.ts +++ b/client/cypress/e2e/register/register.cy.ts @@ -39,6 +39,11 @@ describe('registration', () => { cy.get('[data-cy = "username-input"]').find('[id$=-helper-text]').contains('Username available') + cy.get('[data-cy = "password-input"]').type('123456').find('input').should('have.value', '123456') + + cy.get('[data-cy = "password-input"]').find('[id$=-helper-text]').contains('Too weak') + + cy.get('[data-cy = "password-input"]').find('input').clear() //TODO: Make a cypress custom command that generates a valid password (that is strong determined by passwordStrength() from npm module `check-password-strength`) as well as one generating an invalid one cy.get('[data-cy = "password-input"]') .type(`Test-user-${randomId}`) @@ -47,7 +52,7 @@ describe('registration', () => { //TODO: uncomment the following code when the UI implements the input field for password repeat // cy.get('[data-cy = "password-repeat-input"]').type(`Test/user/${randomId}`).should('have.value', `Test/user/${randomId}`); - cy.get('[data-cy = "password-input"]').find('[id$=-helper-text]').contains('Strong') + cy.get('[data-cy = "password-input"]').find('[id$=-helper-text]').should('not.have', 'Too weak') cy.get('[data-cy = "register-button"]') .click()