Skip to content
Snippets Groups Projects
Commit 5edbeb5d authored by hollum's avatar hollum
Browse files

integration tests for new profile page

parent e5b094be
No related branches found
No related tags found
No related merge requests found
Pipeline #164733 passed
...@@ -37,10 +37,10 @@ describe('Create goal', () => { ...@@ -37,10 +37,10 @@ describe('Create goal', () => {
cy.get('.card-link') cy.get('.card-link')
.eq(0).click() .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.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.get('#btn-delete-goal').click()
cy.wait('@createRequest') cy.wait('@createRequest')
......
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}`)
})
})
...@@ -105,7 +105,7 @@ before(() => { ...@@ -105,7 +105,7 @@ before(() => {
...athleteUser, ...athleteUser,
...generateUser() ...generateUser()
} }
//registerUser(coachUser) registerUser(coachUser)
registerUser(athleteUser) registerUser(athleteUser)
cy.visit(`${baseUrl}/index.html`) cy.visit(`${baseUrl}/index.html`)
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment