Back to list
psh-inc

playwright

by psh-inc

0🍴 0📅 Jan 24, 2026

SKILL.md


name: playwright description: | Playwright E2E testing for customer frontend Use when: Writing E2E tests for Angular customer frontend, testing authentication flows, testing game listings, testing profile/KYC workflows allowed-tools: Read, Edit, Write, Glob, Grep, Bash

Playwright Skill

Playwright E2E testing for the Angular 17 customer frontend (casino-customer-f/). Tests cover authentication, game browsing, wallet operations, KYC verification, and sports betting flows. All tests run headless by default with full browser automation support.

Quick Start

Running Tests

cd casino-customer-f

# Run all E2E tests
npm run e2e

# Interactive UI mode for debugging
npm run e2e:ui

# Run specific test file
npx playwright test tests/auth.spec.ts

# Run with headed browser
npx playwright test --headed

Basic Test Structure

// tests/games.spec.ts
import { test, expect } from '@playwright/test';

test.describe('Game Lobby', () => {
  test.beforeEach(async ({ page }) => {
    await page.goto('/games');
  });

  test('should display game categories', async ({ page }) => {
    await expect(page.getByRole('heading', { name: 'Slots' })).toBeVisible();
    await expect(page.getByTestId('game-grid')).toHaveCount(1);
  });
});

Key Concepts

ConceptUsageExample
Page Object ModelEncapsulate page interactionsLoginPage.login(user)
Test FixturesShare setup across teststest.use({ storageState })
LocatorsPrefer accessible selectorsgetByRole('button')
AssertionsUse web-first assertionsawait expect(el).toBeVisible()
SnapshotsVisual regression testingexpect(page).toHaveScreenshot()

Common Patterns

Authentication Flow Test

When: Testing login, registration, or protected routes

test('user can login and access wallet', async ({ page }) => {
  await page.goto('/login');
  await page.getByLabel('Email').fill('test@example.com');
  await page.getByLabel('Password').fill('SecurePass123');
  await page.getByRole('button', { name: 'Sign In' }).click();
  
  await expect(page).toHaveURL('/dashboard');
  await page.getByRole('link', { name: 'Wallet' }).click();
  await expect(page.getByTestId('balance-display')).toBeVisible();
});

Form Validation Testing

When: Testing bonus claims, KYC forms, deposit forms

test('shows validation errors on invalid deposit', async ({ page }) => {
  await page.goto('/wallet/deposit');
  await page.getByLabel('Amount').fill('-50');
  await page.getByRole('button', { name: 'Deposit' }).click();
  
  await expect(page.getByText('Amount must be positive')).toBeVisible();
});

Waiting for API Responses

When: Testing actions that trigger backend calls

test('game session starts after API response', async ({ page }) => {
  await page.goto('/games');
  
  const responsePromise = page.waitForResponse('**/api/v1/games/*/session');
  await page.getByTestId('game-card-starburst').click();
  const response = await responsePromise;
  
  expect(response.status()).toBe(200);
  await expect(page.getByTestId('game-iframe')).toBeVisible();
});

See Also

  • angular - Frontend framework for customer application
  • typescript - Language for test files

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon