Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Projeto final de TAC-3 (UNIVASF): Testes automatizados de API (JSONPlaceholder) e Web com Python (Requests, Pytest, Unittest, Selenium, Playwright) e Robot Framework.

License

Notifications You must be signed in to change notification settings

realsnywy/tac3-projeto-final-testes

Repository files navigation

Projeto Final de Testes: Integração com APIs e Testes Automatizados

Este projeto demonstra testes automatizados para a API JSONPlaceholder e cenários web, utilizando Pytest, Unittest, Selenium, Playwright e Robot Framework.

📦 Estrutura do Projeto

tac3-projeto-final-testes/
├── app/                  # Módulos de cliente API e automação web
│   ├── api_client.py
│   └── web_automation.py
├── tests/                # Testes com Pytest/Unittest
│   ├── test_api.py
│   ├── test_web.py
│   └── conftest.py
├── tests_robot/          # Testes com Robot Framework
│   ├── api_tests.robot
│   ├── ui_tests.robot
│   └── CustomKeywords.py
├── requirements.txt
├── pytest.ini
├── test_run.log          # Log dos testes Pytest
└── README.md             # Este arquivo

🛠️ Ferramentas Utilizadas

  • Linguagem: Python
  • Testes de API: Requests, Pytest, Unittest
  • Testes Web: Selenium, Playwright
  • Testes de Aceitação: Robot Framework (RequestsLibrary, SeleniumLibrary)
  • Documentação/Design de API (opcional): Apidog

⚙️ Configuração do Ambiente

  1. Crie e ative um ambiente virtual Python:

    python -m venv venv
    # Windows: venv\Scripts\activate
    # macOS/Linux: source venv/bin/activate
  2. Instale as dependências:

    pip install -r requirements.txt
  3. Instale o Playwright (usado com Pytest):

    playwright install
  4. Configure o Selenium:

    • Certifique-se de que o chromedriver (ou driver do seu navegador) está no PATH do sistema.

🚀 Execução dos Testes

Testes com Pytest (tests/)

  • Executar todos os testes:

    pytest
  • Execução detalhada e logs no console:

    pytest -v -s
  • Executar por marcador (ex: api, web):

    pytest -m api
  • Log da execução: salvo em test_run.log.

Testes com Robot Framework (tests_robot/)

  • Executar todos os testes:

    robot tests_robot/
  • Executar um arquivo específico:

    robot tests_robot/api_tests.robot
  • Executar por tag (ex: api, formulario):

    robot -i api tests_robot/
  • Relatórios: log.html e report.html são gerados no diretório raiz.

📁 Descrição dos Diretórios

  • app/: Módulos de integração HTTP (api_client.py) e automação web (web_automation.py).
  • tests/: Suítes de teste com Pytest/Unittest. conftest.py gerencia fixtures e logging.
  • tests_robot/: Testes Robot Framework (.robot) e keywords Python reutilizáveis (CustomKeywords.py).

💡 Ferramentas Opcionais

  • Apidog: Para design, documentação e execução de testes de API via interface gráfica.
  • Robot Framework: Implementado em tests_robot/ para testes de aceitação automatizados de API e UI.

📚 Referências


Projeto desenvolvido para a disciplina TAC-3 - Tópicos Avançados em Computação III - Testes.

Última revisão: 17/06/2025

About

Projeto final de TAC-3 (UNIVASF): Testes automatizados de API (JSONPlaceholder) e Web com Python (Requests, Pytest, Unittest, Selenium, Playwright) e Robot Framework.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published