All files / runtime/_services nav-page-object.ts

100% Statements 20/20
100% Branches 5/5
100% Functions 5/5
100% Lines 20/20

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211x 1x 1x 1x 1x 3x 3x 3x 3x 1x 1x 3x 3x 1x 1x 3x 3x 1x 1x 3x  
import type { Locator, Page } from '@playwright/test';
 
/**
 * Page-object a SideNav / Header navigációhoz. Wave-1: minimalista — link-by-text.
 */
export class DyE2E_NavPageObject {
  constructor(private readonly page: Page) {}
 
  async clickLink(label: string): Promise<void> {
    await this.page.getByRole('link', { name: label, exact: true }).first().click();
  }
 
  async clickButton(label: string): Promise<void> {
    await this.page.getByRole('button', { name: label, exact: true }).first().click();
  }
 
  get sideNav(): Locator {
    return this.page.locator('dynamo-side-nav, [role="complementary"]').first();
  }
}