From 2f76759691a9725c7f5118f24de6d8fe8c285ff7 Mon Sep 17 00:00:00 2001 From: Justin Willis Date: Wed, 15 Nov 2023 15:45:38 -0800 Subject: [PATCH] Test fixes (#4532) fixes #4531 ## PR Type Build or CI related changes ## Describe the current behavior? Tests were failing because of the issue described in the linked bug. ## Describe the new behavior? Tests have been updated to: - account for the `visually-hidden` text - properly wait on the tests to pass before testing to see if the package button is disabled or not ## PR Checklist - [x ] Test: run `npm run test` and ensure that all tests pass - [ xTarget main branch (or an appropriate release branch if appropriate for a bug fix) - [x ] Ensure that your contribution follows [standard accessibility guidelines](https://docs.microsoft.com/en-us/microsoft-edge/accessibility/design). Use tools like https://webhint.io/ to validate your changes. ## Additional Information Co-authored-by: Justin Willis (HE / HIM) Co-authored-by: Beth Pan --- apps/pwabuilder/tests/report-card.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/pwabuilder/tests/report-card.spec.ts b/apps/pwabuilder/tests/report-card.spec.ts index a17f18338..b1a1dfd55 100644 --- a/apps/pwabuilder/tests/report-card.spec.ts +++ b/apps/pwabuilder/tests/report-card.spec.ts @@ -34,7 +34,7 @@ test('ensure demo app is testable', async ({ page }) => { await expect(reportCardAppTitle).toBeVisible(); // // expect reportCardAppTitle to contain text "Webboard" - await expect(reportCardAppTitle).toHaveText('Webboard'); + await expect(reportCardAppTitle).toContainText('Webboard'); }); test('ensure Package For Stores button is not disabled for demo app', async ({ page }) => { @@ -53,6 +53,8 @@ test('ensure Package For Stores button is not disabled for demo app', async ({ p // wait for tests to end await page.waitForLoadState('networkidle'); + await page.waitForSelector("id=swProgressRing"); + // test manifest score const packageForStoresButton = page.locator('text=Package For Stores'); await expect(await packageForStoresButton.isDisabled()).toBe(false);