From b10e0922c3dd547d5a6ea38ca06e5ae9d4c8596b Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 12 Apr 2023 09:10:34 +0200 Subject: [PATCH] Merge pull request #22022 from storybookjs/fix-e2e-tests Fix e2e tests failing in Firefox --- code/e2e-tests/util.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/e2e-tests/util.ts b/code/e2e-tests/util.ts index 1630dbadbdc3..7b59f27369ae 100644 --- a/code/e2e-tests/util.ts +++ b/code/e2e-tests/util.ts @@ -37,8 +37,9 @@ export class SbPage { // assert url changes const viewMode = name === 'docs' ? 'docs' : 'story'; - const url = this.page.url(); - await expect(url).toContain(`path=/${viewMode}/${titleId}--${storyId}`); + await this.page.waitForURL((url) => + url.search.includes(`path=/${viewMode}/${titleId}--${storyId}`) + ); const selected = await storyLink.getAttribute('data-selected'); await expect(selected).toBe('true');