Skip to content

Latest commit

 

History

History
143 lines (102 loc) · 3.24 KB

File metadata and controls

143 lines (102 loc) · 3.24 KB

Test Suites Quick Reference

This document provides a quick reference for running different test suites with various parameters.

Quick Commands

Using Maven

# Smoke tests on dev
mvn test -DsuiteXmlFile=test-suites/smoke-suite.xml -Denvironment=dev

# Regression tests on staging
mvn test -DsuiteXmlFile=test-suites/regression-suite.xml -Denvironment=staging

# Full suite on production
mvn test -DsuiteXmlFile=test-suites/full-suite.xml -Denvironment=prod

# API tests only
mvn test -DsuiteXmlFile=test-suites/api-suite.xml -Denvironment=dev

# Frontend tests only
mvn test -DsuiteXmlFile=test-suites/frontend-suite.xml -Denvironment=dev

Using Test Runner Script

# Smoke tests (default: dev)
./run-tests.sh smoke

# Regression tests on staging
./run-tests.sh regression staging

# Full suite on production
./run-tests.sh full prod

# API tests on dev
./run-tests.sh api dev

# Frontend tests on staging
./run-tests.sh frontend staging

Test Suite Details

1. Smoke Suite (smoke-suite.xml)

  • Purpose: Quick validation of critical functionality
  • Tests:
    • LoginPageTest.testValidLogin
    • HomePageTest.testHomePageElements
    • UserAPITest.testGetUser
  • Default Environment: dev
  • Parallel: tests, 2 threads

2. Regression Suite (regression-suite.xml)

  • Purpose: Comprehensive regression testing
  • Tests: All tests with regression group
  • Default Environment: staging
  • Parallel: tests, 3 threads

3. Full Suite (full-suite.xml)

  • Purpose: Complete test coverage
  • Tests: All frontend and API tests
  • Default Environment: dev
  • Parallel: tests, 4 threads

4. API Suite (api-suite.xml)

  • Purpose: API testing only
  • Tests: All API tests
  • Default Environment: dev
  • Parallel: methods, 3 threads

5. Frontend Suite (frontend-suite.xml)

  • Purpose: Frontend testing only
  • Tests: All frontend tests
  • Default Environment: dev
  • Parallel: tests, 2 threads

6. Default Suite (testng.xml)

  • Purpose: Default test execution
  • Tests: All tests
  • Default Environment: dev
  • Parallel: tests, 2 threads

Environment Options

  • dev - Development environment
  • staging - Staging environment
  • prod - Production environment

Test Groups

Tests are tagged with groups for flexible execution:

  • smoke: Critical functionality tests
  • regression: Full regression test suite

Running by Groups

# Run only smoke tests
mvn test -Dgroups=smoke

# Run only regression tests
mvn test -Dgroups=regression

Customizing Test Suites

To customize a test suite, edit the corresponding XML file in test-suites/:

  1. Change the environment parameter value
  2. Add/remove test classes or methods
  3. Adjust thread-count for parallel execution
  4. Modify parallel attribute (tests, methods, classes)

Examples

CI/CD Integration

# In your CI pipeline
mvn test -DsuiteXmlFile=test-suites/smoke-suite.xml -Denvironment=staging

Local Development

# Quick smoke test
./run-tests.sh smoke dev

# Full regression before commit
./run-tests.sh regression dev

Production Validation

# Full suite on production
mvn test -DsuiteXmlFile=test-suites/full-suite.xml -Denvironment=prod