From 10097c5423615f9526c2ddf1324a3cac7e3d1ab3 Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Tue, 1 Mar 2022 12:43:27 -0800 Subject: [PATCH] (core) Add check for test login page in homeUtil.ts Summary: The old regex for login pages, /gristlogin/, used to handle test login pages too, matching on a query param set in the URL. A recent change to make the regex more specific broke this. This fixes that regression by adding an additional check to isOnLoginPage for the presence of the test login page. Test Plan: N/A (fixing test) Reviewers: paulfitz Reviewed By: paulfitz Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D3300 --- test/nbrowser/homeUtil.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/nbrowser/homeUtil.ts b/test/nbrowser/homeUtil.ts index 2d0369c9..7b1bbcb1 100644 --- a/test/nbrowser/homeUtil.ts +++ b/test/nbrowser/homeUtil.ts @@ -253,10 +253,11 @@ export class HomeUtil { } /** - * Returns whether we are currently on the Cognito login page. + * Returns whether we are currently on the Cognito or test login page. */ public async isOnLoginPage() { - return /^https:\/\/gristlogin/.test(await this.driver.getCurrentUrl()); + const url = await this.driver.getCurrentUrl(); + return /^https:\/\/gristlogin/.test(url) || await this.isOnTestLoginPage(); } /**