mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Update failing HomeIntro core test
Summary: Core doesn't redirect to Cognito or our own sign-up page when clicking 'sign up' on the welcome screen. Instead, it redirects to the test login page. Test Plan: N/A (fixing test) Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3298
This commit is contained in:
parent
c91593e312
commit
83ba2957bf
@ -915,7 +915,7 @@ export class FlexServer implements GristServer {
|
||||
res.send(`<!doctype html>
|
||||
<html><body>
|
||||
<div class="modal-content-desktop">
|
||||
<h1>A Very Creduluous Login Page</h1>
|
||||
<h1>A Very Credulous Login Page</h1>
|
||||
<p>
|
||||
A minimal login screen to facilitate testing.
|
||||
I'll believe anything you tell me.
|
||||
|
@ -266,6 +266,13 @@ export class HomeUtil {
|
||||
return /^https:\/\/login(-s)?\.getgrist\.com/.test(await this.driver.getCurrentUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether we are currently on the test login page.
|
||||
*/
|
||||
public async isOnTestLoginPage() {
|
||||
return await this.driver.findContent('h1', 'A Very Credulous Login Page');
|
||||
}
|
||||
|
||||
/**
|
||||
* Waits for browser to navigate to Cognito login page.
|
||||
*/
|
||||
@ -281,11 +288,24 @@ export class HomeUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* Waits for browser to navigate to either the Cognito or Grist login page.
|
||||
* Waits for browser to navigate to test login page.
|
||||
*/
|
||||
public async checkTestLoginPage(waitMs: number = 2000) {
|
||||
await this.driver.wait(this.isOnTestLoginPage.bind(this), waitMs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Waits for browser to navigate to any login page (e.g. Cognito, Grist, test).
|
||||
*/
|
||||
public async checkSigninPage(waitMs: number = 4000) {
|
||||
await this.driver.wait(
|
||||
async () => await this.isOnLoginPage() || await this.isOnGristLoginPage(),
|
||||
async () => {
|
||||
return (
|
||||
await this.isOnLoginPage() ||
|
||||
await this.isOnGristLoginPage() ||
|
||||
await this.isOnTestLoginPage()
|
||||
);
|
||||
},
|
||||
waitMs
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user