From 52eb5325c23f1015fd94cd7eed5b66eccff01dce Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Thu, 5 May 2022 13:33:27 -0700 Subject: [PATCH] (core) Use different user in ActionLog tests Summary: Nearby deployment tests used the same user, which was causing the full suite to fail. Repeated logins with a second verification step (TOTP) fail in Cognito if the same verification code is used twice. This happened to be the case since the gap between tests wasn't long enough for a new code to be generated. Test Plan: Manually verified deployment tests now pass. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3414 --- test/nbrowser/ActionLog.ts | 2 +- test/nbrowser/homeUtil.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/nbrowser/ActionLog.ts b/test/nbrowser/ActionLog.ts index 3284ec81..49459ea4 100644 --- a/test/nbrowser/ActionLog.ts +++ b/test/nbrowser/ActionLog.ts @@ -24,7 +24,7 @@ describe('ActionLog', function() { } before(async function() { - const session = await gu.session().user('user4').login(); + const session = await gu.session().user('user1').login(); await session.tempDoc(cleanup, 'Hello.grist'); await gu.dismissWelcomeTourIfNeeded(); }); diff --git a/test/nbrowser/homeUtil.ts b/test/nbrowser/homeUtil.ts index 23705852..7aa93fef 100644 --- a/test/nbrowser/homeUtil.ts +++ b/test/nbrowser/homeUtil.ts @@ -179,9 +179,13 @@ export class HomeUtil { const code = authenticator.generate(secret); await this.driver.find('input[name="verificationCode"]').sendKeys(code); await this.driver.find('.test-mfa-submit').click(); - await this.driver.wait(async () => { - return !await this.driver.findContent('.test-mfa-title', 'Almost there!').isPresent(); - }, 4000); + await this.driver.wait( + async () => { + return !await this.driver.findContent('.test-mfa-title', 'Almost there!').isPresent(); + }, + 4000, + 'Possible reason: verification code is invalid or expired (i.e. was recently used to log in)' + ); } /**