Created
April 17, 2021 13:56
-
-
Save slawekradzyminski/849de87690bd1b584b6a3e2b55844b80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <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