diff --git a/frontend/cypress/integration/goals.spec.js b/frontend/cypress/integration/goals.spec.js index d8a120bf18b9f9224ee684c4ce00429801de86ce..e0708ff3bc5ee8cacfb66ebe8b6c5c825d7ba3ed 100644 --- a/frontend/cypress/integration/goals.spec.js +++ b/frontend/cypress/integration/goals.spec.js @@ -37,10 +37,10 @@ describe('Create goal', () => { cy.get('.card-link') .eq(0).click() - cy.intercept({method: 'GET', url: '/api/goal/2/' }).as('createRequest') + cy.intercept({method: 'GET', url: '/api/goal/1/' }).as('createRequest') cy.wait('@createRequest') - cy.intercept({method: 'DELETE', url: '/api/goal/2/' }).as('createRequest') + cy.intercept({method: 'DELETE', url: '/api/goal/1/' }).as('createRequest') cy.get('#btn-delete-goal').click() cy.wait('@createRequest') diff --git a/frontend/cypress/integration/profile.spec.js b/frontend/cypress/integration/profile.spec.js new file mode 100644 index 0000000000000000000000000000000000000000..028f773f50c0ac4508ede9764f6deb97d733e004 --- /dev/null +++ b/frontend/cypress/integration/profile.spec.js @@ -0,0 +1,30 @@ + + +describe('Test profile page', () => { + + it('Edit profile', function() { + this.login(this.athleteUser) + + cy.get('#nav-profile').click() + cy.get('#phone_number').type("12345678") + cy.get('#btn-edit-account').click() + cy.url().should('include', 'profile.html') + }) + + + it('Connect to coach and see if the coach is added in profile', function() { + this.login(this.athleteUser) + + cy.get('#nav-mycoach').click() + cy.get('#input-coach').type(`${this.coachUser.username}`, {force: true}) + + cy.get('#button-edit-coach').click() + cy.get('#button-set-coach').click({force: true}) + cy.wait(2000) + + cy.get('#nav-profile').click() + cy.url().should('include', 'profile.html') + cy.get('#coach-content').contains(`${this.coachUser.username}`) + }) + +}) diff --git a/frontend/cypress/support/index.js b/frontend/cypress/support/index.js index 9fe152b105da5e7c40519c50b41428e42b023e06..d63cbb61f5aefa07a13fc97a9819d486aa39d044 100644 --- a/frontend/cypress/support/index.js +++ b/frontend/cypress/support/index.js @@ -105,7 +105,7 @@ before(() => { ...athleteUser, ...generateUser() } - //registerUser(coachUser) + registerUser(coachUser) registerUser(athleteUser) cy.visit(`${baseUrl}/index.html`) })