Skip to content
Snippets Groups Projects
Commit 97bbb7ec authored by Jørgen Hollum's avatar Jørgen Hollum :blowfish:
Browse files

removed unnecessary comment

parent d8d51f97
No related branches found
No related tags found
No related merge requests found
Pipeline #169450 passed with stages
in 1 minute and 59 seconds
......@@ -112,99 +112,3 @@ beforeEach(() => {
cy.wrap(athleteUser).as('athleteUser')
cy.wrap(login).as('login')
})
/*
import './commands'
import './commands'
var coachUser = {
username: "coachUser",
password: "123",
email: 'coach@example.com',
phone_number: '12345678',
street_address: 'Roadstreet 1',
city: 'Citytown',
country: 'Countryland',
main_gym: "SiT Moholt",
favourite_exercise: "Bench press"
}
var athleteUser = {
username: "athleteUser",
password: "123",
email: 'athlete@example.com',
phone_number: '98765432',
street_address: 'Streetroad 2',
city: 'Towncity',
country: 'Landcountry',
main_gym: "SiT Moholt",
favourite_exercise: "Bench press"
}
var baseUrl = "localhost:9090"
function registerUser(user) {
cy.visit(`${baseUrl}/index.html`)
cy.contains('Welcome to SecFit!')
cy.get('#btn-register').click()
cy.url().should('include', 'register.html')
cy.get('input[name="username"]').type(user.username)
cy.get('input[name="email"]').type(user.email)
cy.get('input[name="password"]').type(user.password)
cy.get('input[name="password1"]').type(user.password)
cy.get('input[name="phone_number"]').type(user.phone_number)
cy.get('input[name="country"]').type(user.country)
cy.get('input[name="city"]').type(user.city)
cy.get('input[name="street_address"]').type(user.street_address)
cy.get('input[name="main_gym"]').type(user.main_gym)
cy.get('input[name="favourite_exercise"]').type(user.favourite_exercise)
cy.get('#btn-create-account').click()
cy.url().should('include', 'workouts.html')
// cy.log("Waiting 1.5 seconds to allow request to go through. Should probably be replaced with a register-watcher, but hey watcha gonna doooo")
// cy.wait(1500)
logout()
}
function login(user) {
cy.visit(`${baseUrl}/index.html`)
cy.contains('Welcome to SecFit!')
cy.get('#btn-login-nav').click()
cy.url().should('include', 'login.html')
cy.get('input[name="username"]').type(user.username)
cy.get('input[name="password"]').type(user.password)
cy.intercept({method: 'GET', url: '/workouts.html' }).as('loginRequest')
cy.get('#btn-login').click()
cy.wait('@loginRequest')
}
function logout() {
cy.get('#btn-logout', { timeout: 10000 }).click()
cy.url().should('include', 'index.html')
}
before(() => {
registerUser(coachUser)
registerUser(athleteUser)
cy.visit(`${baseUrl}/index.html`)
})
beforeEach(() => {
cy.wrap(coachUser).as('coachUser')
cy.wrap(athleteUser).as('athleteUser')
cy.wrap(login).as('login')
})
*/
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