Skip to content

Joselv1990/playwright-typescript-e2e

Repository files navigation

🎭 Web E2E — Playwright + TypeScript

Playwright TypeScript CI

Automação E2E web com Playwright e TypeScript, estruturada com Page Object Model e fixtures customizadas, rodando em GitHub Actions com relatório HTML.

🇬🇧 Web E2E automation with Playwright and TypeScript — Page Object Model, custom fixtures and an HTML report on GitHub Actions CI.

App alvo: Swag Labs / saucedemo.com.


✨ Destaques técnicos

  • Page Object Model — telas encapsuladas (LoginPage, InventoryPage, CartPage, CheckoutPage).
  • Fixtures customizadas — Page Objects injetados nos testes (fixtures/pages.ts), specs limpos e DRY.
  • TypeScript strict — tipagem forte em locators e ações.
  • Locators resilientesdata-test e roles em vez de seletores frágeis.
  • Auto-wait nativo do Playwright — sem sleep manual.
  • Trace, screenshot e vídeo automáticos em falhas.
  • Tags@smoke, @negative, @regression.
  • CI — execução headless + relatório HTML como artifact.

🧱 Estrutura

pages/        → Page Objects
fixtures/     → injeção dos Page Objects (test.extend)
tests/        → specs (login, checkout)
playwright.config.ts

✅ Pré-requisitos

  • Node.js 18+

🚀 Como executar

npm ci
npx playwright install --with-deps chromium

npm test                 # headless
npm run test:headed      # com navegador visível
npm run test:ui          # modo UI interativo
npm run report           # abre o último relatório HTML

Filtrar por tag:

npx playwright test --grep @smoke

🧪 Cenários cobertos

Login

  • Login válido → catálogo (inventory)
  • locked_out_user → bloqueado com erro
  • Credenciais inválidas → mensagem de erro

Compras & Checkout

  • Adicionar itens → badge do carrinho atualiza
  • Fluxo completo de compra → "Thank you for your order!"

👤 Autor

Jose Luis Vieira — QA Engineer | Automation (Web, Mobile & API) GitHub · LinkedIn

About

Web E2E automation with Playwright + TypeScript - Page Object Model, fixtures, HTML report and GitHub Actions CI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors