File tree Expand file tree Collapse file tree 2 files changed +24
-12
lines changed
templates/app/e2e/account(auth)/login Expand file tree Collapse file tree 2 files changed +24
-12
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,18 @@ describe('Login View', function() {
5656 describe ( 'with local auth' , function ( ) {
5757
5858 it ( 'should login a user and redirecting to "/"' , function ( ) {
59- page . login ( testUser ) ;
60-
61- var navbar = require ( '../../components/navbar/navbar.po' ) ;
62-
63- expect ( browser . getCurrentUrl ( ) ) . toBe ( config . baseUrl + '/' ) ;
64- expect ( navbar . navbarAccountGreeting . getText ( ) ) . toBe ( 'Hello ' + testUser . name ) ;
59+ return page . login ( testUser ) . then ( ( ) => {
60+ var navbar = require ( '../../components/navbar/navbar.po' ) ;
61+
62+ return browser . wait (
63+ ( ) => element ( by . css ( '.hero-unit' ) ) ,
64+ 5000 ,
65+ `Didn't find .hero-unit after 5s`
66+ ) . then ( ( ) => {
67+ expect ( browser . getCurrentUrl ( ) ) . toBe ( config . baseUrl + '/' ) ;
68+ expect ( navbar . navbarAccountGreeting . getText ( ) ) . toBe ( 'Hello ' + testUser . name ) ;
69+ } ) ;
70+ } ) ;
6571 } ) ;
6672
6773 it ( 'should indicate login failures' , function ( ) {
Original file line number Diff line number Diff line change @@ -56,12 +56,18 @@ describe('Login View', function() {
5656 describe ( 'with local auth' , function ( ) {
5757
5858 it ( 'should login a user and redirecting to "/"' , function ( ) {
59- page . login ( testUser ) ;
60-
61- var navbar = require ( '../../components/navbar/navbar.po' ) ;
62-
63- < %= expect ( ) % > browser . getCurrentUrl ( ) < %= to ( ) % > . eventually . equal ( config . baseUrl + '/' ) ;
64- < %= expect ( ) % > navbar . navbarAccountGreeting . getText ( ) < %= to ( ) % > . eventually . equal ( 'Hello ' + testUser . name ) ;
59+ return page . login ( testUser ) . then ( ( ) => {
60+ var navbar = require ( '../../components/navbar/navbar.po' ) ;
61+
62+ return browser . wait (
63+ ( ) => element ( by . css ( '.hero-unit' ) ) ,
64+ 5000 ,
65+ `Didn't find .hero-unit after 5s`
66+ ) . then ( ( ) => {
67+ < %= expect ( ) % > browser . getCurrentUrl ( ) < %= to ( ) % > . eventually . equal ( config . baseUrl + '/' ) ;
68+ < %= expect ( ) % > navbar . navbarAccountGreeting . getText ( ) < %= to ( ) % > . eventually . equal ( 'Hello ' + testUser . name ) ;
69+ } ) ;
70+ } ) ;
6571 } ) ;
6672
6773 describe ( 'and invalid credentials' , function ( ) {
You can’t perform that action at this time.
0 commit comments