Skip to content

This project use Newman to test an API response. Then, use htmlextra to generate a report. At the final, publish the html report on the Github Pages.

Notifications You must be signed in to change notification settings

IgorMW/jornadacolaborativa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 

Repository files navigation

PoC Jornada Colaborativa

PoC para testar retorno de API do IBGE com algumas validações utilizando Newman, Github Actions e Github Pages.

O endpoint escolhido retorna os 20 nomes mais comuns no Brasil. Cuja resposta possui o seguinte padrão:

[
    {
        "localidade": "string",
        "sexo": "string",
        "res": [
            {
                "nome": "string",
                "frequencia": number,
                "ranking": number
            }
        ]
    }
]

São realizados 3 testes básicos na resposta recebida:

  • Código de resposta igual a http 200
  • Resposta menor que 10 segundos
  • Ter no corpo da resposta o vigésimo nome

A criação do relatório é realizada utilizando a imagem dannydainton/htmlextra.

          docker container run -t -v $(pwd):/etc/newman dannydainton/htmlextra \
          run 'jornadacolaborativa.postman_collection.json' \
          -k \
          -r cli,htmlextra \
          --reporter-htmlextra-export /etc/newman/docs/index.html \
          --reporter-htmlextra-browserTitle "Jornada Colaborativa" \
          --reporter-htmlextra-title "Jornada Colaborativa - Nomes Mais Comuns No Brasil"

Etapa de publicação no GitHub Pages. Utilizamos o GitHub Pages Action para isso.

      - name: Publish Report
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./docs

About

This project use Newman to test an API response. Then, use htmlextra to generate a report. At the final, publish the html report on the Github Pages.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published