CLI de testes E2E com IA: linguagem natural vira Playwright executável.
Project description
Agente Testes
CLI que transforma pedidos em linguagem natural em testes Playwright executáveis, com relatório e evidências — powered by CrewAI.
Repositório: https://github.com/BrunooooPaiva/agente-testes
Instalação global (recomendado)
Pré-requisitos: Python 3.10–3.13, Node.js 18+ (npm/npx no PATH), chave OpenAI.
Opção A — PyPI (recomendado)
pip install --pre agente-testes
agente-testes setup
Com uv:
uv tool install --pre agente-testes
agente-testes setup
Opção B — uv tool a partir do repositório
cd agente_testes
uv tool install --prerelease=allow .
agente-testes setup
Opção C — repositório Git
pip install "agente-testes @ git+https://github.com/BrunooooPaiva/agente-testes.git"
agente-testes setup
O comando setup cria ~/.agente-testes/.env, instala @playwright/test e o Chromium no runtime global.
Edite a API key:
notepad $env:USERPROFILE\.agente-testes\.env
Fluxo CLI (3 passos)
# 1. Entre no projeto que quer testar
cd C:\projetos\meu-app
# 2. (opcional) prepara workspace local
agente-testes init
# 3. Com o app rodando (npm run dev), peça o teste
agente-testes run "Validar login com e-mail inválido na rota /login"
Saída esperada: status ✅/❌, caminhos do relatório, spec e artefatos em .agente-testes/.
Comandos
| Comando | Descrição |
|---|---|
agente-testes run "<pedido>" |
Fluxo completo com IA: análise → Playwright → execução → relatório |
agente-testes exec <spec> |
Executa spec versionado sem IA (ideal para CI) |
agente-testes init |
Cria .agente-testes/ e entradas no .gitignore do projeto |
agente-testes doctor |
Valida Python, API key, npx, Playwright, URL e portas locais |
agente-testes setup |
Instala runtime Playwright (uso global) |
agente-testes --verbose run ... |
Logs completos do CrewAI |
Exemplo determinístico (CT-02 versionado):
agente-testes exec tests/e2e/demo-login-invalid.spec.js --repo fixtures/demo-app
Flags úteis do run: --repo, --url, --skip-url-check.
Desenvolvimento local
cd agente_testes
uv sync
npm install
npx playwright install chromium
copy .env.example .env
# Edite OPENAI_API_KEY em .env
uv run agente-testes doctor
uv run python scripts/start_demo.py # http://localhost:3000/login
Demo E2E:
cd fixtures\demo-app
uv run agente-testes init
uv run agente-testes run "Validar login com e-mail inválido na rota /login"
Smoke (sem LLM):
uv run python scripts/smoke_tools.py
Configuração
| Onde | Variável | Uso |
|---|---|---|
~/.agente-testes/.env |
OPENAI_API_KEY |
Obrigatória (instalação global) |
Projeto alvo .env |
AGENTE_TESTES_APP_URL |
URL do app sob teste |
| CLI | --url |
Sobrescreve URL na execução |
Artefatos ficam em <projeto>/.agente-testes/ (output/, artifacts/, temp_specs/).
Estrutura
src/agente_testes/ CLI, crew, tools, self-healing
fixtures/demo-app/ App HTTP de demonstração (:3000)
scripts/ smoke, demo, hooks de commit
docs/COMMITS.md Padrão de commits do projeto
Segurança
- Nunca commite
.env; use.env.example/~/.agente-testes/.env - Tools bloqueiam leitura de secrets no repositório alvo
- Subprocess Playwright usa env mínimo (sem
OPENAI_API_KEY)
Validação em app externo (CT-05, só local)
Apps reais na sua máquina podem ser usados para teste manual (agente-testes run com --repo implícito via cwd). Isso não faz parte do CI nem dos specs versionados deste pacote. Guia: docs/CT-05.md.
Padrões Next.js + toast Sonner: fixture fixtures/nextjs-sonner-fixture/.
Fase 5 — qualidade
- Pré-leitura de login antes da IA (
login_preflight) - Healing proativo ao salvar specs
- Testes:
uv run --group dev pytest tests/ -q
Detalhes: docs/FASE-5.md
CI (GitHub Actions)
- Automático em PR/push: smoke + pytest +
exec(sem custo de API) — verdocs/CI.md - Manual com IA: workflow
E2E com IA+ secretOPENAI_API_KEY— verdocs/CI.md#secret-obrigatório
Licença
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agente_testes-0.4.9.tar.gz.
File metadata
- Download URL: agente_testes-0.4.9.tar.gz
- Upload date:
- Size: 298.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38a73d5e4d30f42348af114c69f61db8467c3cc4cbcd10113bbb004470a7b22d
|
|
| MD5 |
3201dfac7612b7207d066bd9df20c772
|
|
| BLAKE2b-256 |
fe273603b5d33c6fe1114552b0d027c7cc4b3e5dd5cf3136c2678edd4e65000a
|
Provenance
The following attestation bundles were made for agente_testes-0.4.9.tar.gz:
Publisher:
publish-pypi.yml on BrunooooPaiva/agente-testes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agente_testes-0.4.9.tar.gz -
Subject digest:
38a73d5e4d30f42348af114c69f61db8467c3cc4cbcd10113bbb004470a7b22d - Sigstore transparency entry: 1802300414
- Sigstore integration time:
-
Permalink:
BrunooooPaiva/agente-testes@3e7ba811d3932279cbaeb66aca053509c2de8a2f -
Branch / Tag:
refs/tags/v0.4.9 - Owner: https://github.com/BrunooooPaiva
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@3e7ba811d3932279cbaeb66aca053509c2de8a2f -
Trigger Event:
release
-
Statement type:
File details
Details for the file agente_testes-0.4.9-py3-none-any.whl.
File metadata
- Download URL: agente_testes-0.4.9-py3-none-any.whl
- Upload date:
- Size: 58.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdbc0a524a01b58ac091c06074d8327d1a1b6db0ec8813e6be00e40e145b8414
|
|
| MD5 |
c8c353cd8a830be0c15c82285744c6db
|
|
| BLAKE2b-256 |
9d6f5c1bab5b275d8c6bb4e47e4d1d7ec26d8a1c68907cd29794e5d95163c263
|
Provenance
The following attestation bundles were made for agente_testes-0.4.9-py3-none-any.whl:
Publisher:
publish-pypi.yml on BrunooooPaiva/agente-testes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agente_testes-0.4.9-py3-none-any.whl -
Subject digest:
fdbc0a524a01b58ac091c06074d8327d1a1b6db0ec8813e6be00e40e145b8414 - Sigstore transparency entry: 1802300506
- Sigstore integration time:
-
Permalink:
BrunooooPaiva/agente-testes@3e7ba811d3932279cbaeb66aca053509c2de8a2f -
Branch / Tag:
refs/tags/v0.4.9 - Owner: https://github.com/BrunooooPaiva
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@3e7ba811d3932279cbaeb66aca053509c2de8a2f -
Trigger Event:
release
-
Statement type: