{"id":28718741,"url":"https://github.com/mahamorim/playwright-copilot-evolution","last_synced_at":"2026-04-28T17:02:45.010Z","repository":{"id":293155732,"uuid":"983091510","full_name":"MahAmorim/playwright-copilot-evolution","owner":"MahAmorim","description":"Guided evolution of an end-to-end login test suite with Playwright and GitHub Copilot. From prompt design to production-ready testing.","archived":false,"fork":false,"pushed_at":"2025-05-14T00:09:16.000Z","size":609,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-15T05:03:33.351Z","etag":null,"topics":["ai","copilot","e2e-testing","learning-project","playwright","playwright-tests","software-quality","test-automation","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MahAmorim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-13T21:34:44.000Z","updated_at":"2025-06-13T13:57:47.000Z","dependencies_parsed_at":"2025-05-14T01:36:44.194Z","dependency_job_id":"1461771b-8fe1-47a5-9262-0f84d4245dae","html_url":"https://github.com/MahAmorim/playwright-copilot-evolution","commit_stats":null,"previous_names":["mahamorim/playwright-copilot-evolution"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MahAmorim/playwright-copilot-evolution","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahAmorim%2Fplaywright-copilot-evolution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahAmorim%2Fplaywright-copilot-evolution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahAmorim%2Fplaywright-copilot-evolution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahAmorim%2Fplaywright-copilot-evolution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MahAmorim","download_url":"https://codeload.github.com/MahAmorim/playwright-copilot-evolution/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MahAmorim%2Fplaywright-copilot-evolution/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32390067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","copilot","e2e-testing","learning-project","playwright","playwright-tests","software-quality","test-automation","typescript"],"created_at":"2025-06-15T05:03:34.842Z","updated_at":"2026-04-28T17:02:44.998Z","avatar_url":"https://github.com/MahAmorim.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Playwright Login Tests – Guided Evolution with GitHub Copilot\n\n![Playwright](https://img.shields.io/badge/Tested%20with-Playwright-45ba63?logo=playwright)\n\nThis project is a **learning-driven exploration** of automated testing using [Playwright](https://playwright.dev/) and AI tools like GitHub Copilot.\nIt demonstrates how **iteratively refining prompts** and using **Copilot with intention** can lead to robust, maintainable test suites.\n\nEach version (from `v1-basic` to `v5-final`) reflects a level of maturity, progressing from a working script to a production-ready solution.\n\n---\n\n### 🌟 Project Goal\nTo study:\n\n* How prompt engineering influences the quality of generated test code\n* Best practices in Playwright E2E testing\n* How GitHub Copilot can be guided with configuration files and prompt strategies\n\nIn QA and test automation, most teams start with working tests — few reach reliable, scalable architectures. This project bridges that gap using AI.\n\n\u003e 📁 Check each version in the `/playwright-tests/` folder\n\n---\n\n### 📊 Test Evolution (v1 to v5)\n\n| Version | File Name             | Description                                                                      |\n| ------- | --------------------- | -------------------------------------------------------------------------------- |\n| v1      | `v1-basic.spec.ts`    | Basic, functional code with global variables and no reuse or grouping            |\n| v2      | `v2-fixes.spec.ts`    | Adds `afterEach`, minimal improvements, but still lacks structure                |\n| v3      | `v3-cleanup.spec.ts`  | Adds screenshots and improves flow, but still without modular login              |\n| v4      | `v4-scalable.spec.ts` | Introduces login helper, `describe()` grouping, proper afterEach, timeout tuning |\n| v5      | `v5-final.spec.ts`    | Clean, reusable, professional code with `test.skip` and structured grouping      |\n\n\n\n\u003e 💡 Each version solves a specific pain point:\n\u003e - v1 → gets things working fast (good for PoC or MVP)\n\u003e - v2 → adds debugging value via screenshots\n\u003e - v3 → improves resilience and traceability\n\u003e - v4 → introduces modularity for reusability\n\u003e - v5 → aligns with team-level quality and future growth\n\n\n---\n\n### Getting Started\n\n#### Prerequisites\n\n* [Node.js](https://nodejs.org/) installed\n* Install dependencies:\n\n  ```bash\n  npm install\n  npx playwright install\n  ```\n\n#### Running Tests\n\n```bash\nnpx playwright test              # Run all tests\nnpx playwright test --headed     # Run tests with browser visible\nnpx playwright test --debug      # Debug mode\nnpx playwright show-report       # View HTML report\n```\n\n---\n\n### Tests Included\n\n* **Login page elements are visible**\n* **Invalid login shows error**\n* **Valid login redirects**\n* **Locked-out user shows error**\n* **Empty credentials show error**\n* **Password field is masked**\n* **Dismiss error message**\n\n---\n\n### GitHub Copilot Configuration\n\nThis project uses **custom Copilot instructions** to guide the generation of technical and clean TypeScript code.\n\n#### Copilot Settings\n\n```json\n{\n  \"github.copilot.chat.codeGeneration.instructions\": [\n    {\n      \"file\": \"copilot-instructions.md\"\n    }\n  ]\n}\n```\n\n#### Instruction File (`copilot-instructions.md`)\n\n```md\nYou are an expert in TypeScript, Frontend development, and Playwright end-to-end testing.\nYou write concise, technical TypeScript code with accurate examples and the correct types.\n\n- Always use the recommended built-in and role-based locators (getByRole, getByLabel, etc.)\n- Prefer to use web-first assertions whenever possible\n- Use built-in config objects like devices whenever possible\n- Avoid hardcoded timeouts\n- Reuse Playwright locators by using variables\n- Follow the guidance and best practices described on playwright.dev\n- Avoid commenting the resulting code\n```\n\n---\n\n### 🔎 Prompt Used to Generate Final Version (v5)\n\n\\[Click to expand]\n\n\u003cdetails\u003e\n\u003csummary\u003eView final prompt\u003c/summary\u003e\n\n```md\nCrie uma suíte de testes automatizados usando Playwright em TypeScript para a página de login do site https://www.saucedemo.com/. A suíte deve seguir as melhores práticas do Playwright e atender aos seguintes requisitos:\n\nRequisitos Técnicos:\nConfiguração Geral:\n\n- Use BASE_URL como constante para a URL do site.\n- Utilize test.beforeEach para:\n  - Navegar para BASE_URL.\n  - Aplicar waitForLoadState('domcontentloaded') para garantir que a página esteja carregada.\n  - Inicializar locators reutilizáveis para os elementos principais:\n    - Campo de usuário → getByPlaceholder('Username')\n    - Campo de senha → getByPlaceholder('Password')\n    - Botão de login → getByRole('button', { name: 'Login' })\n- Implemente test.afterEach para capturar screenshots com nomes baseados no título do teste (after-[testname].png).\n\nTestes a serem implementados:\n\n- Verificar elementos da página de login\n- Login inválido\n- Login válido\n- Usuário bloqueado\n- Campos vazios\n- Campo de senha mascarado\n- Fechar mensagem de erro\n\nBoas Práticas:\n\n- Use assertions web-first (toBeVisible, toHaveURL, toHaveAttribute, etc.)\n- Evite timeouts fixos e utilize os mecanismos internos do Playwright\n- Reutilize locators sempre que possível\n- Extraia uma função utilitária login(page, username, password) para reduzir repetição\n- Capture screenshots para cada teste e salve na pasta screenshots com nomes descritivos\n- Use test.describe para agrupar testes logicamente (e.g., \"Erros\", \"Usabilidade\")\n- Use test.skip ou test.todo para cenários futuros\n\nCenários Futuros:\n\n- Persistência de sessão após atualização da página\n- Funcionalidade de logout e redirecionamento para a página de login\n- Teste de responsividade em dispositivos móveis e tablets usando Playwright devices\n\nObservações:\n\n- O código deve ser limpo, conciso e seguir as melhores práticas descritas na documentação oficial do Playwright\n- Evite comentários desnecessários no código gerado\n```\n\n\u003c/details\u003e\n\n---\n\n### 🌎 Project Configuration Summary\n\n* Global timeout: `60000ms`\n* Headed mode by default (`headless: false`)\n* SlowMo: `500ms` delay\n* Video recording: `on`\n* Screenshot: only on failure\n* Trace: retained on failure\n* Projects: Chromium, Firefox, WebKit\n\n---\n\n### 📂 Project Structure\n\n```\n/playwright-copilot/\n│\n├── README.md                \n├── README.pt-BR.md          \n│\n├── playwright.config.ts\n├── package.json\n├── package-lock.json\n│\n├── /playwright-tests/\n│   ├── 01-basic.spec.ts\n│   ├── 02-fixes.spec.ts\n│   ├── 03-cleanup.spec.ts\n│   ├── 04-scalable.spec.ts\n│   └── 05-final.spec.ts\n│\n├── /screenshots/\n├── /test-results/\n├── /playwright-report/\n│\n├── /docs/\n│   ├── prompt-final.md\n│   └── copilot-instructions.md\n```\n\n---\n\n## 📙 References\n\n* [Playwright Docs](https://playwright.dev)\n* [Copilot Docs](https://docs.github.com/en/copilot)\n* [SauceDemo](https://www.saucedemo.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahamorim%2Fplaywright-copilot-evolution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahamorim%2Fplaywright-copilot-evolution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahamorim%2Fplaywright-copilot-evolution/lists"}