mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Update HomeIntro.ts to check for either login page
Summary: The "Sign In" button can either redirect you to the Cognito login page or the Grist sign-up page, depending on whether you've logged in before. Since the HomeIntro tests can either be run as part of a full deployment test suite, or individually, the test could redirect you to both types of login pages. Test Plan: N/A (fixing test) Reviewers: paulfitz Reviewed By: paulfitz Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D3291
This commit is contained in:
parent
ff4e5d2769
commit
a294eefdff
@ -27,10 +27,9 @@ describe('HomeIntro', function() {
|
|||||||
const signUp = await driver.findContent('.test-welcome-text a', 'sign up');
|
const signUp = await driver.findContent('.test-welcome-text a', 'sign up');
|
||||||
assert.include(await signUp.getAttribute('href'), '/signin');
|
assert.include(await signUp.getAttribute('href'), '/signin');
|
||||||
|
|
||||||
// Check that the link takes us to a login page.
|
// Check that the link takes us to a login page (either Cognito or Grist, depending on session).
|
||||||
await signUp.click();
|
await signUp.click();
|
||||||
// External servers redirect to Grist sign-up page if client has no sessions.
|
await gu.checkSigninPage();
|
||||||
server.isExternalServer() ? await gu.checkGristLoginPage() : await gu.checkLoginPage();
|
|
||||||
await driver.navigate().back();
|
await driver.navigate().back();
|
||||||
await gu.waitForDocMenuToLoad();
|
await gu.waitForDocMenuToLoad();
|
||||||
});
|
});
|
||||||
|
@ -43,6 +43,7 @@ export const setValue = homeUtil.setValue.bind(homeUtil);
|
|||||||
export const isOnLoginPage = homeUtil.isOnLoginPage.bind(homeUtil);
|
export const isOnLoginPage = homeUtil.isOnLoginPage.bind(homeUtil);
|
||||||
export const checkLoginPage = homeUtil.checkLoginPage.bind(homeUtil);
|
export const checkLoginPage = homeUtil.checkLoginPage.bind(homeUtil);
|
||||||
export const checkGristLoginPage = homeUtil.checkGristLoginPage.bind(homeUtil);
|
export const checkGristLoginPage = homeUtil.checkGristLoginPage.bind(homeUtil);
|
||||||
|
export const checkSigninPage = homeUtil.checkSigninPage.bind(homeUtil);
|
||||||
|
|
||||||
export const fixturesRoot: string = testUtils.fixturesRoot;
|
export const fixturesRoot: string = testUtils.fixturesRoot;
|
||||||
|
|
||||||
|
@ -273,10 +273,20 @@ export class HomeUtil {
|
|||||||
/**
|
/**
|
||||||
* Waits for browser to navigate to Grist login page.
|
* Waits for browser to navigate to Grist login page.
|
||||||
*/
|
*/
|
||||||
public async checkGristLoginPage(waitMs: number = 4000) {
|
public async checkGristLoginPage(waitMs: number = 2000) {
|
||||||
await this.driver.wait(this.isOnGristLoginPage.bind(this), waitMs);
|
await this.driver.wait(this.isOnGristLoginPage.bind(this), waitMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Waits for browser to navigate to either the Cognito or Grist login page.
|
||||||
|
*/
|
||||||
|
public async checkSigninPage(waitMs: number = 4000) {
|
||||||
|
await this.driver.wait(
|
||||||
|
async () => await this.isOnLoginPage() || await this.isOnGristLoginPage(),
|
||||||
|
waitMs
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete and recreate the user, via the specified org. The specified user must be
|
* Delete and recreate the user, via the specified org. The specified user must be
|
||||||
* currently logged in!
|
* currently logged in!
|
||||||
|
Loading…
Reference in New Issue
Block a user