mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +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:
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user