From 1ed34aebac90f5c3200d24a7be73e69716dc1d7d Mon Sep 17 00:00:00 2001 From: Steve Larson <9larsons@gmail.com> Date: Wed, 31 Jan 2024 11:52:09 -0600 Subject: [PATCH] Added check for Stripe Pass in Stripe Connect test utils (#19633) refs https://linear.app/tryghost/issue/ENG-599 - Portal tests occasionally failed without clear cause on CI, possibly due to GH runner region - Portal tests never successfully ran locally for US-based IPs because of a required prompt for Stripe Pass --- ghost/core/test/e2e-browser/utils/e2e-browser-utils.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ghost/core/test/e2e-browser/utils/e2e-browser-utils.js b/ghost/core/test/e2e-browser/utils/e2e-browser-utils.js index a4bec039e3..63fafd6b9e 100644 --- a/ghost/core/test/e2e-browser/utils/e2e-browser-utils.js +++ b/ghost/core/test/e2e-browser/utils/e2e-browser-utils.js @@ -330,6 +330,14 @@ const completeStripeSubscription = async (page) => { await fillInputIfExists(page, '#billingAddressLine2', 'Apt 1'); await fillInputIfExists(page, '#billingLocality', 'Testville'); + // some regions have a stripe pass checkbox that blocks the submit button + if (await page.isVisible('#enableStripePass')) { + const checkbox = await page.locator('#enableStripePass'); + if (await checkbox.isChecked()) { + await checkbox.uncheck(); + } + } + // Wait for submit button complete await page.waitForSelector('[data-testid="hosted-payment-submit-button"].SubmitButton--complete', {state: 'attached'});