controleonline/smoke-tests-playground
Bundle Symfony para expor tests de varios tipos como API JSON.
composer require controleonline/smoke-tests-playground:dev-master
O pacote nao renderiza UI HTML. A leitura publica acontece por:
GET /testsGET /tests/index.json como alias de compatibilidadeGET /tests/apiOs artifacts publicados pelos smoke tests ficam disponiveis por:
GET /tests/artifacts/{suiteId}/{arquivo}O frontend separado em tests-frontend-tool consome essa API com X-API-KEY.
Cada tipo e suite continuam gravando em:
var/tests/<type>/<suite>/report.jsonvar/tests/<type>/<suite>/report.xmlvar/tests/<type>/<suite>/*.pngvar/tests/<type>/<suite>/*/*.pngO report.json ou report.xml fica por suite. O bundle varre todos os tipos e suites e monta um index.json agregado com:
nvm no servidor, se ainda nao existir:curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
nvm install --lts
nvm use --lts
npm install -D @playwright/test
node node_modules/@playwright/test/cli.js install
config/bundles.php:ControleOnline\SmokeTestsPlayground\SmokeTestsPlaygroundBundle::class => ['all' => true],
php bin/console smoke-tests-playground:install
O instalador escreve:
.env com os defaults do smokeconfig/routes/smoke_tests_playground.yamlconfig/services/smoke_tests_playground.yamlSe a instalacao dos browsers falhar por permissao, o comando imprime instrucoes para executar como root.
PLAYWRIGHT_BROWSERS_PATH="0" evita depender do cache global do usuario.SMOKE_TESTS_PLAYGROUND_TESTS_PATH aponta para a raiz dos smoke tests, por padrao var/tests.SMOKE_TESTS_PLAYGROUND_RUN_COMMAND define o comando do runner, por padrao:node node_modules/@playwright/test/cli.js test --config=playwright.config.cjs tests/browser/*.spec.js
SMOKE_TESTS_PLAYGROUND_RUN_WORKDIR define o diretorio de execucao.SMOKE_TESTS_PLAYGROUND_RUN_TIMEOUT define o timeout em segundos.GET /tests retorna o indice agregado canônicoGET /tests/index.json retorna o mesmo JSON para compatibilidadeGET /tests/api retorna o mesmo JSON para compatibilidadeGET /tests/artifacts/{suiteId}/{arquivo} entrega os artifacts publicadosPOST /tests/run continua disponivel para disparar o runner do backendO indice publico tem a estrutura geral:
{
"generatedAt": "2026-07-06T18:51:19.924Z",
"status": "failed",
"progress": 50,
"message": "1 suite com falha em 2 publicadas.",
"lastRunAt": "2026-07-06T18:51:19.924Z",
"summary": {
"types": {
"total": 2,
"passed": 1,
"failed": 1
},
"suites": {
"total": 2,
"passed": 1,
"failed": 1
},
"tests": {
"total": 2,
"passed": 1,
"failed": 1
}
},
"types": [],
"suites": []
}
Cada tipo publica:
typedisplayNamestatusprogressmessagesummarysuites[]Cada suite publica:
typetypeDisplayNamesuitesuitePathsuiteIddisplayNamegeneratedAtupdatedAtstatussummarytests[]links.reportCada screenshot publica:
labelnameurlmimeTypekindavailableO projeto tests-frontend-tool consome a API via .env:
API_ENTRYPOINT=https://staging.frethical.com
HTACCESS_USER=<user>
HTACCESS_PASSWORD=<password>
Ele nao executa smoke tests. Ele so le index.json, mostra suites/tests/etapas e faz preview dos artifacts.
Exemplo de leitura do indice:
curl -H "Accept: application/json" \
-H "X-API-KEY: <api-key>" \
"https://<your-host>/tests/index.json"
Exemplo de artifact:
curl -H "X-API-KEY: <api-key>" \
"https://<your-host>/tests/artifacts/<suiteId>/01-login-screen.png" \
--output login-screen.png
O pacote tem testes para:
How can I help you explore Laravel packages today?