diff --git a/packages/playground-website/e2e/ui.e2e.ts b/packages/playground-website/e2e/ui.e2e.ts index 13df836d894..82afe809d2a 100644 --- a/packages/playground-website/e2e/ui.e2e.ts +++ b/packages/playground-website/e2e/ui.e2e.ts @@ -41,13 +41,9 @@ test.describe("playground UI tests", () => { const typespecEditor = page.locator(".monaco-editor").first(); await typespecEditor.click(); await typespecEditor.pressSequentially("op sharedCode(): string;"); - await Promise.all([ - // It is important to call waitForNavigation before click to set up waiting. - page.waitForURL( - // cspell:disable-next-line - new RegExp(`${host}/\\?.*c=b3Agc2hhcmVkQ29kZSgpOiBzdHJpbmc7.*`), - ), - page.keyboard.press(`${ctrlOrCmd}+KeyS`), - ]); + await page.keyboard.press(`${ctrlOrCmd}+KeyS`); + // cspell:disable-next-line + const sharedCodeQueryPattern = new RegExp(`${host}/\\?.*c=b3Agc2hhcmVkQ29kZSgpOiBzdHJpbmc7.*`); + await expect.poll(() => page.url()).toMatch(sharedCodeQueryPattern); }); });