Skip to content

Instantly share code, notes, and snippets.

@felippepuhle
Last active May 5, 2020 14:59
Show Gist options
  • Select an option

  • Save felippepuhle/580e2eae23e6008d8beca0c16b2330a7 to your computer and use it in GitHub Desktop.

Select an option

Save felippepuhle/580e2eae23e6008d8beca0c16b2330a7 to your computer and use it in GitHub Desktop.
import HomePage from '../elements/pages/HomePage';
describe('Sign In', () => {
it('should show an error message on empty input', () => {
const home = new HomePage();
home.visit();
const signIn = home.goToSignIn();
signIn.submit();
signIn.getEmailError()
.should('exist')
.contains('Email is required');
signIn
.getPasswordError()
.should('exist')
.contains('Password is required');
});
it('should sign in with correct credentials', () => {
const home = new HomePage();
home.visit();
const signIn = home.goToSignIn();
signIn
.fillEmail('john@doe.com')
.fillPassword('123456')
.submit();
home.getUserAvatar().should('exist');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment