Files
egbim_qa_platform/apps/e2e/utils/navigation.ts
T
root 33453ecc55
Deploy staging / deploy (push) Failing after 6s
Initial deployment setup
2026-08-31 16:45:24 +09:00

35 lines
1.2 KiB
TypeScript

import type { Page } from '@playwright/test';
const WEB_URL = 'http://localhost:3000';
export const openProjectDashboard = async (page: Page) => {
await page.goto(`${WEB_URL}/main`, { waitUntil: 'domcontentloaded' });
await page.waitForURL(/\/main\/project\/\d+\/dashboard/, {
timeout: 30000,
});
const projectId = new URL(page.url()).pathname.split('/')[3];
if (!projectId) throw new Error(`Project id was not found in ${page.url()}`);
return projectId;
};
export const openFeedbackPage = async (page: Page) => {
const projectId = await openProjectDashboard(page);
await page.goto(`${WEB_URL}/main/project/${projectId}/feedback`, {
waitUntil: 'domcontentloaded',
});
await page.waitForURL(/channelId=/, { timeout: 30000 });
const channelId = new URL(page.url()).searchParams.get('channelId');
if (!channelId) throw new Error(`Channel id was not found in ${page.url()}`);
return { projectId, channelId };
};
export const openIssuePage = async (page: Page) => {
const projectId = await openProjectDashboard(page);
await page.goto(`${WEB_URL}/main/project/${projectId}/issue`, {
waitUntil: 'domcontentloaded',
});
return projectId;
};