Skip to content

Repository files navigation

🎭 CodeceptJS + TypeScript Hybrid Automation Framework

Playwright/CodeceptJS CI TypeScript CodeceptJS NodeJS Docker

A hybrid test automation framework (E2E & API) built with CodeceptJS and TypeScript. It demonstrates SDET engineering practices, including hybrid testing strategies (bypassing UI login via API), Page Object Model (POM), schema validation, and an integrated CI/CD pipeline.


🎯 Target Application

Tests are executed against the ServeRest ecosystem:

  • API REST: https://serverest.dev
  • Web UI: https://front.serverest.dev

🏗️ Architecture & Best Practices

This repository utilizes a modular architecture focused on reusability, maintainability, and high execution speed:

  • Hybrid Strategy: Prepares test data and authenticates directly via API prior to UI execution (reducing total suite execution time by up to 70%).
  • Page Object Model (POM): Encapsulates locators and user interactions within dedicated page classes.
  • Strict Typing: TypeScript applied across all layers (requests, responses, and page objects).
  • Integrated CI/CD: GitHub Actions workflow with parallel execution, test report generation, and failure artifact archiving.
├── .github/workflows/   # CI/CD Workflows (GitHub Actions)
├── config/              # Global & Environment configurations
├── features/            # Gherkin feature files
├── step_definitions/    # Gherkin step definitions
├── src/
│   ├── api/             # API helpers and typings
│   ├── web/             # Page Objects and UI components
└── codecept.conf.ts     # Main CodeceptJS configuration file

🛠️ Tech Stack

  • Language: TypeScript
  • Test Framework: CodeceptJS (with Playwright & REST Helpers)
  • Data Generator: @faker-js/faker
  • Reporting: Allure Report / HTML Reporter
  • CI/CD & Containers: GitHub Actions & Docker

🚀 Getting Started Locally

Prerequisites

  • Node.js v18+ installed
  • npm or yarn

1. Clone the repository

git clone https://github.com/bfsouza/codeceptjs-typescript-sdet-framework.git
cd codeceptjs-typescript-sdet-framework

2. Install dependencies

npm install

3. Run the Tests

# Run all Gherkin feature tests
npm run test

# Run API feature tests only
npm run test:api

# Run Web (UI) feature tests only
npm run test:web

# Run Hybrid feature tests only
npm run test:hybrid

# Print steps while running Gherkin features
npm run test:ui

# Generate the Allure report from the latest results
npm run report

🐳 Running with Docker

To run the entire test suite inside an isolated container environment:

# Build the Docker image
docker build -t codeceptjs-sdet .

# Execute the test suite
docker run --rm codeceptjs-sdet

📊 Test Reports

After executing tests, detailed reports containing screenshots and videos of failed scenarios can be generated using:

npm run report

Test artifacts from PRs or main branch builds are also available for download under the Actions tab on GitHub.


✉️ Contact

Developed by Bruno Felipi de Souza - LinkedIn - Email

About

Automated E2E & API testing framework built with CodeceptJS, TypeScript, and Docker for ServeRest application. Includes CI/CD pipeline via GitHub Actions

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages