Guest User

Untitled

a guest
Dec 3rd, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. import { LoginPage } from './login.po';
  2. import { PublicPage } from '../public/public.po';
  3. describe('protractor-tutorial - Login page', () => {
  4. let page: LoginPage;
  5. let publicPage: PublicPage;
  6.  
  7. const wrongCredentias = {
  8. username: 'wrongname',
  9. password: 'wrongpasswd'
  10. };
  11.  
  12. beforeEach(() => {
  13. page = new LoginPage();
  14. publicPage = new PublicPage();
  15. });
  16.  
  17. it('when user trying to login with wrong credentials he should stay on “login” page and see error notification', () => {
  18. page.navigateTo();
  19. page.fillCredentials(wrongCredentias);
  20. expect(page.getPageTitleText()).toEqual('Login');
  21. expect(page.getErrorMessage()).toEqual('Username or password is incorrect');
  22. });
  23.  
  24. it('when login is successful — he should redirect to default “public” page', () => {
  25. page.navigateTo();
  26. page.fillCredentials();
  27. expect(publicPage.getPageTitleText()).toEqual('Public');
  28. });
Add Comment
Please, Sign In to add comment