Skip to content

Instantly share code, notes, and snippets.

@slawekradzyminski
Created April 17, 2021 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slawekradzyminski/849de87690bd1b584b6a3e2b55844b80 to your computer and use it in GitHub Desktop.
Save slawekradzyminski/849de87690bd1b584b6a3e2b55844b80 to your computer and use it in GitHub Desktop.
/// <reference types="cypress" />
import { loginPage } from "../../pages/loginpage"
import { getRandomString } from "../../util/randomutil"
context('Register tests', () => {
const username = getRandomString()
const password = getRandomString()
beforeEach(() => {
cy.visit('/login')
cy.intercept('GET', '**/users', { fixture: 'users.json' })
})
it('Should successfully login', () => {
cy.stubSuccessfulLogin(username)
loginPage.login(username, password)
cy.wait('@loginRequest')
.its('request.body')
.should('deep.equal', {
"username": username,
"password": password
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment