1- import { guidedTour } from '../../views/tour' ;
21import { nav } from '../../views/nav' ;
2+ import { guidedTour } from '../../views/tour' ;
33
44
55
@@ -16,6 +16,7 @@ declare global {
1616 loginNoSession ( provider : string , username : string , password : string , oauthurl : string ) : Chainable < Element > ;
1717 adminCLI ( command : string , options ?) ;
1818 executeAndDelete ( command : string ) ;
19+ validateLogin ( ) : Chainable < Element > ;
1920 }
2021 }
2122}
@@ -79,6 +80,12 @@ declare global {
7980 ) ;
8081 }
8182
83+ Cypress . Commands . add ( 'validateLogin' , ( ) => {
84+ cy . visit ( '/' ) ;
85+ cy . byTestID ( "username" , { timeout : 120000 } ) . should ( 'be.visible' ) ;
86+ guidedTour . close ( ) ;
87+ } ) ;
88+
8289 // Session-wrapped login
8390 Cypress . Commands . add (
8491 'login' ,
@@ -96,9 +103,7 @@ declare global {
96103 {
97104 cacheAcrossSpecs : true ,
98105 validate ( ) {
99- cy . visit ( '/' ) ;
100- cy . byTestID ( "username" , { timeout : 120000 } ) . should ( 'be.visible' ) ;
101- guidedTour . close ( ) ;
106+ cy . validateLogin ( ) ;
102107 } ,
103108 } ,
104109 ) ;
@@ -108,6 +113,7 @@ declare global {
108113 // Non-session login (for use within sessions)
109114 Cypress . Commands . add ( 'loginNoSession' , ( provider : string , username : string , password : string , oauthurl : string ) => {
110115 performLogin ( provider , username , password , oauthurl ) ;
116+ cy . validateLogin ( ) ;
111117 } ) ;
112118
113119 Cypress . Commands . add ( 'switchPerspective' , ( perspective : string ) => {
0 commit comments