Skip to content

Open source alternative to Semrush and Ahrefs

test(e2e): update landing redirect assertions for dashboard landing page (#109)

Xiaonan Cui0d654c06e652
diff --git a/e2e/domain-overview-test-utils.ts b/e2e/domain-overview-test-utils.ts
index 7cfd65d7..89774b0d 100644
--- a/e2e/domain-overview-test-utils.ts
+++ b/e2e/domain-overview-test-utils.ts
@@ -181,11 +181,11 @@ export async function openDomainOverview(page: Page, tab: DomainTab) {
window.sessionStorage.setItem("domain-overview-e2e-cleared", "1");
});
await page.goto("/");
- await page.waitForURL(/\/p\/([^/]+)\/keywords(?:\?.*)?$/, {
+ await page.waitForURL(/\/p\/([^/]+)\/?$/, {
timeout: 30_000,
});
- const match = page.url().match(/\/p\/([^/]+)\/keywords/);
+ const match = page.url().match(/\/p\/([^/]+)/);
if (!match) throw new Error(`Could not read project id from ${page.url()}`);
const params = new URLSearchParams({
diff --git a/e2e/keyword-research-navigation.spec.ts b/e2e/keyword-research-navigation.spec.ts
index 0da192c7..c4cc95bb 100644
--- a/e2e/keyword-research-navigation.spec.ts
+++ b/e2e/keyword-research-navigation.spec.ts
@@ -2,11 +2,11 @@ import { expect, test, type Page } from "@playwright/test";
async function getProjectId(page: Page) {
await page.goto("/");
- await page.waitForURL(/\/p\/([^/]+)\/keywords(?:\?.*)?$/, {
+ await page.waitForURL(/\/p\/([^/]+)\/?$/, {
timeout: 30_000,
});
- const match = page.url().match(/\/p\/([^/]+)\/keywords/);
+ const match = page.url().match(/\/p\/([^/]+)/);
if (!match) throw new Error(`Could not read project id from ${page.url()}`);
return match[1];
}