From 7bfe5db7165ada19c0f3780262202c618214d6d0 Mon Sep 17 00:00:00 2001 From: Sam Lord Date: Thu, 1 Dec 2022 12:30:43 +0000 Subject: [PATCH] Ensure tests pass when pointing at a remote server no issue This will need some work, since we are introducing a 500ms delay to wait for a network request to return. Ideally the tier expander should eventually populate itself. --- ghost/core/test/e2e-browser/utils/e2e-browser-utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 7d7271de0e..bf06fef7fb 100644 --- a/ghost/core/test/e2e-browser/utils/e2e-browser-utils.js +++ b/ghost/core/test/e2e-browser/utils/e2e-browser-utils.js @@ -138,7 +138,7 @@ const createTier = async (page, {name, monthlyPrice, yearlyPrice}) => { await page.locator('.gh-setting-group').filter({hasText: 'Membership'}).click(); // Expand the premium tier list await page.getByRole('button', {name: 'Expand'}).nth(1).click({ - delay: 50 // TODO: Figure out how to prevent this from opening with an empty list without using delay + delay: 500 // TODO: Figure out how to prevent this from opening with an empty list without using delay }); // Archive if already exists @@ -147,6 +147,7 @@ const createTier = async (page, {name, monthlyPrice, yearlyPrice}) => { await tierCard.locator('.gh-tier-card-actions-button').click(); await tierCard.getByRole('button', {name: 'Archive'}).click(); await page.locator('.modal-content').getByRole('button', {name: 'Archive'}).click(); + await page.locator('.modal-content').waitFor({state: 'detached', timeout: 1000}); } await page.locator('.gh-btn-add-tier').click();