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

This commit is contained in:
Xiaonan Cui 2026-07-23 21:50:09 +08:00 committed by GitHub
parent 95e95d48cb
commit 0d654c06e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -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({

View File

@ -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];
}