FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

module-federation-examples/playwright-e2e at master · jonthomp/module-federation-examples · GitHub

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Playwright e2e
(Module Federation Examples)

Structure

playwright-e2e
├── common
│   ├── base.ts
│   ├── basePage.ts
│   ├── selectors.ts
│   └── testFixtures.ts
├── fixtures
│   ├── constants.ts
│   ├── commonTestData.ts
│   └── nextjsSsr.json
├── helpers
│   ├── base-helper.ts
│   └── file-actions-helper.ts
├── types
│   ├── cssAttr.ts
│   ├── dates.ts
│   ├── requestsTypes.ts
│   └── stubTypes.ts
└── results (optional)
  • common holds reusable test helpers and selectors.
  • fixtures contains shared test data.
  • helpers contains utilities for data generation and file operations.
  • types contains enums and shared types used by tests.
  • results is used by reporters when enabled (optional).

Run tests

All commands should be executed from the repo root.

Interactive

pnpm exec playwright test --ui

Headless

pnpm exec playwright test --reporter=list

Run a single sample

Most samples include a Playwright config in the sample directory:

pnpm exec playwright test --config <sample>/playwright.config.ts

Or via the sample script:

pnpm --filter <sample-name> e2e:ci

Writing tests

Use Playwright's test runner and shared helpers from playwright-e2e.

import { test } from '@playwright/test';
import { BaseMethods } from '../../playwright-e2e/common/base';

// Example
// test('does something', async ({ page }) => {
//   const base = new BaseMethods(page);
//   await base.openLocalhost({ number: 3000 });
// });

When adding reusable helpers, place them in playwright-e2e/common/base.ts.


Back | FazBrowse Home | New Git URL