@ -78,7 +78,7 @@ export class HomeUtil {
// When running against an external server, we log in through Cognito.
await this . driver . get ( this . server . getUrl ( org , "" ) ) ;
// Check if we got redirected to the Grist sign-up page.
if ( await this . isOn Signup Page( ) ) {
if ( await this . isOn GristLogin Page( ) ) {
await this . driver . findWait ( 'a[href*="login?"]' , 4000 ) . click ( ) ;
} else if ( ! ( await this . isOnLoginPage ( ) ) ) {
// Explicitly click sign-in link if necessary.
@ -86,7 +86,7 @@ export class HomeUtil {
await this . driver . findContentWait ( '.grist-floating-menu a' , 'Sign in' , 500 ) . click ( ) ;
}
// Check if we need to switch to Cognito login from the Grist sign-up page.
if ( await this . isOn Signup Page( ) ) {
if ( await this . isOn GristLogin Page( ) ) {
await this . driver . findWait ( 'a[href*="login?"]' , 4000 ) . click ( ) ;
}
await this . checkLoginPage ( ) ;
@ -263,10 +263,10 @@ export class HomeUtil {
}
/ * *
* Returns whether we are currently on the Grist sign - up page .
* Returns whether we are currently on a Grist login page .
* /
public async isOn Signup Page() {
return /login(-s)?\.getgrist\.com \/signup /. test ( await this . driver . getCurrentUrl ( ) ) ;
public async isOn GristLogin Page() {
return /login(-s)?\.getgrist\.com /. test ( await this . driver . getCurrentUrl ( ) ) ;
}
/ * *
@ -276,6 +276,13 @@ export class HomeUtil {
await this . driver . wait ( this . isOnLoginPage . bind ( this ) , waitMs ) ;
}
/ * *
* Waits for browser to navigate to Grist login page .
* /
public async checkGristLoginPage ( waitMs : number = 2000 ) {
await this . driver . wait ( this . isOnGristLoginPage . bind ( this ) , waitMs ) ;
}
/ * *
* Delete and recreate the user , via the specified org . The specified user must be
* currently logged in !