mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 20:43:36 +00:00
refactor: move from next js to vite and tanstack router
This commit is contained in:
36
apps/ui/tests/utils/features/timers.ts
Normal file
36
apps/ui/tests/utils/features/timers.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Page, Locator } from "@playwright/test";
|
||||
|
||||
/**
|
||||
* Get the count up timer element for a specific feature card
|
||||
*/
|
||||
export async function getTimerForFeature(
|
||||
page: Page,
|
||||
featureId: string
|
||||
): Promise<Locator> {
|
||||
const card = page.locator(`[data-testid="kanban-card-${featureId}"]`);
|
||||
return card.locator('[data-testid="count-up-timer"]');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the timer display text for a specific feature card
|
||||
*/
|
||||
export async function getTimerDisplayForFeature(
|
||||
page: Page,
|
||||
featureId: string
|
||||
): Promise<string | null> {
|
||||
const card = page.locator(`[data-testid="kanban-card-${featureId}"]`);
|
||||
const timerDisplay = card.locator('[data-testid="timer-display"]');
|
||||
return await timerDisplay.textContent();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a timer is visible for a specific feature
|
||||
*/
|
||||
export async function isTimerVisibleForFeature(
|
||||
page: Page,
|
||||
featureId: string
|
||||
): Promise<boolean> {
|
||||
const card = page.locator(`[data-testid="kanban-card-${featureId}"]`);
|
||||
const timer = card.locator('[data-testid="count-up-timer"]');
|
||||
return await timer.isVisible().catch(() => false);
|
||||
}
|
||||
Reference in New Issue
Block a user