Files
TS_Proto/e2e/pages/dashboard.page.ts
T
nilesh.pandClaude Opus 4.8 4d3eb18a6c Initial commit: TravelHub multi-tenant flight booking platform
Angular + Go + PostgreSQL sample with strict per-tenant isolation.

- Backend: Go API (basic auth, tenant-scoped repository layer, pgx pool)
- Frontend: Angular 22 SPA (search, checkout, bookings, dashboard)
- Database: schema, seed data and demo bookings migrations
- Tests: 311 across Go (integration), Angular (unit) and Playwright (e2e),
  plus a generated evidence report with PDF export
- Security: whitebox VAPT report under security/

Secrets (.env, tokens, DB credentials) are git-ignored.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-13 11:38:01 +05:30

34 lines
1.1 KiB
TypeScript

import { expect, Locator, Page } from '@playwright/test';
/** The agency overview. */
export class DashboardPage {
readonly greeting: Locator;
readonly tiles: Locator;
readonly recentRows: Locator;
readonly topRoutes: Locator;
constructor(private readonly page: Page) {
this.greeting = page.locator('h1');
this.tiles = page.locator('.tile');
this.recentRows = page.locator('table.data tbody tr');
this.topRoutes = page.locator('.route-row');
}
async goto(): Promise<void> {
await this.page.goto('/dashboard');
await this.settled();
}
async settled(): Promise<void> {
await expect(this.page.locator('.skeleton')).toHaveCount(0);
await expect(this.tiles.first()).toBeVisible();
}
/** Reads one headline figure by its label, e.g. "Revenue" or "Seats sold". */
async tileValue(label: string): Promise<number> {
const tile = this.tiles.filter({ has: this.page.locator('.tile-label', { hasText: label }) });
const text = await tile.locator('.tile-value').innerText();
return Number(text.replace(/[^0-9.]/g, ''));
}
}