Created
December 7, 2015 13:11
-
-
Save washingtonsoares/d34206f119cdab052f34 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
describe('Test login', function() { | |
var ptor = protractor.getInstance(); | |
describe('Login correto', function() { | |
it('Testando login e redirecionamento para os cursos', function() { | |
ptor.get('/#/login'); | |
var form = ptor.findElement(By.id('form-login')); | |
var emailInput = form.findElement(By.id('email')).sendKeys('[email protected]'); | |
var passwordInput = form.findElement(By.id('password')).sendKeys('123mudar'); | |
form.submit(); | |
expect(ptor.getCurrentUrl()).toEqual(ptor.baseUrl+'#/'); | |
}); | |
}); | |
describe('Logout', function() { | |
it('Testando o logou e redirecionamento para o login', function() { | |
ptor.findElement(By.id('btn-logout')).click(); | |
expect(ptor.getCurrentUrl()).toEqual(ptor.baseUrl+'#/login'); | |
}); | |
}); | |
describe('Login incorreto', function() { | |
it('Testando um login incorreto e mensagem de email e senha inválidos', function() { | |
var form = ptor.findElement(By.id('form-login')); | |
var emailInput = form.findElement(By.id('email')).sendKeys('[email protected]'); | |
var passwordInput = form.findElement(By.id('password')).sendKeys('12345'); | |
form.submit(); | |
expect(element(by.id('alert-wrong-login')).isPresent()).toEqual(true); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment