Skip to content

Naveen-Ravichandran003/Naveen_DemoProject1

Repository files navigation

Naveen_DemoProject1 – AI-Assisted Selenium Test Automation Framework using Amazon Q Developer

πŸš€ Overview

A comprehensive Selenium WebDriver automation framework built using Java, Maven, and Cucumber BDD.
This project demonstrates how Amazon Q Developer can be used to generate an enterprise-ready test automation framework from scratch using basic, user-friendly prompts, significantly reducing manual development effort. The framework follows modern test automation best practices, including the Page Object Model (POM) and Behavior-Driven Development (BDD), and supports detailed test execution reporting, while being designed for scalability, maintainability, and seamless CI/CD integration.

πŸ† Project Highlights

  • ⚑ Complete Framework Structure generated by Amazon Q Developer
  • πŸ” Manual Code Validation - Reviewed and validated generated code
  • πŸ’¬ User-Friendly Prompts - Provided clear prompts to generate enterprise framework
  • 🎯 3 Test Scenarios with comprehensive coverage (2 passed, 1 intentionally failed)
  • πŸ“Š Multiple Report Formats - Cucumber, TestNG
  • πŸ”„ CI/CD Ready with GitHub Actions
  • πŸ“Έ Visual Evidence with automatic screenshots
  • πŸŽ₯ Complete Demo Recording - End-to-end demonstration available

πŸŽ₯ Demo Recording

A complete end-to-end demonstration of this project, including Amazon Q Developer–assisted framework generation, test execution, and reporting, is available at the link below:

πŸ”— Demo Video (Google Drive): https://drive.google.com/file/d/1jLzyRj0eA2G76cf_fTAeDACaOkITJ09t/view?usp=sharing

πŸ“Š Sample Reports & Screenshots

πŸ₯’ Cucumber Reports

  • Cucumber Report: View Report
  • Cucumber Report Preview: Cucumber Report

πŸ“‹ TestNG Reports

πŸ“Έ Test Screenshots

πŸ€– Amazon Q Developer Contribution

This project was generated using Amazon Q Developer AI assistance with continuous code quality improvements.

What Amazon Q Did

  • Generated the complete project structure
  • Created Page Object Model classes
  • Implemented Cucumber step definitions
  • Configured Maven dependencies with TestNG
  • Set up Allure reporting with TestNG integration
  • Created CI/CD-ready execution scripts
  • Generated comprehensive documentation

Manual Effort by Developer

  • Provided user-friendly prompts to Amazon Q
  • Reviewed and validated generated code
  • Minor refinements for project-specific needs
  • Executed and demonstrated the framework

This demonstrates how Amazon Q can significantly accelerate enterprise-grade test automation development.

πŸ—οΈ Architecture

Core Technologies

  • Java 11 - Programming language
  • Maven - Build and dependency management
  • Selenium WebDriver 4.15.0 - Web automation
  • Cucumber 7.14.0 - BDD framework
  • TestNG 7.8.0 - Test runner with parallel execution
  • Allure 2.24.0 - Advanced reporting
  • WebDriverManager - Browser driver management

Framework Structure

src/
β”œβ”€β”€ main/java/com/acme/
β”‚   β”œβ”€β”€ pages/          # Page Object Model classes
β”‚   β”‚   β”œβ”€β”€ BasePage.java
β”‚   β”‚   β”œβ”€β”€ LoginPage.java
β”‚   β”‚   └── DashboardPage.java
β”‚   └── utils/          # Utility classes
β”‚       β”œβ”€β”€ DriverManager.java
β”‚       β”œβ”€β”€ ScreenshotUtils.java
β”‚       β”œβ”€β”€ ReportOpener.java
β”‚       └── TestNGReportGenerator.java
└── test/
    β”œβ”€β”€ java/com/acme/
    β”‚   β”œβ”€β”€ runners/TestRunner.java
    β”‚   └── stepdefinitions/LoginSteps.java
    └── resources/
        β”œβ”€β”€ features/login.feature
        β”œβ”€β”€ allure.properties
        └── cucumber.properties
testng.xml              # TestNG suite configuration

✨ Key Features

Test Automation Capabilities

  • 🌐 Cross-browser testing (Chrome, Firefox)
  • πŸ“± Headless execution for CI/CD
  • πŸ“Έ Automatic screenshot capture
  • ⏱️ Smart wait strategies
  • πŸ”„ Sequential execution with fresh browser sessions

BDD Implementation

  • πŸ“ Gherkin scenarios for business-readable tests
  • 🎭 Multiple test types (positive, negative, workflow)
  • πŸ“Š Data-driven testing ready
  • πŸ”— Step definition reusability

TestNG Features

  • πŸ“Š Advanced reporting - Custom HTML reports
  • πŸ”§ Flexible annotations - Better test lifecycle control
  • 🎯 Test grouping - Organize tests by categories
  • πŸ“‹ Suite management - XML-based test configuration
  • πŸ”„ Fresh sessions - Clean browser state per scenario

Reporting & Analytics

  • πŸ“ˆ Allure reports - Interactive dashboards
  • 🌐 Cucumber HTML reports - Standard BDD reporting
  • πŸ“Š TestNG HTML reports - Detailed execution reports
  • πŸ“Š JSON/XML exports - CI/CD integration
  • πŸ“Έ Visual test evidence - Screenshots in reports

🎯 Test Scenarios

Implemented Test Cases

  1. User Login - Valid credential authentication
  2. Dashboard Access - Post-login navigation verification
  3. User Logout - Complete session termination
  4. Negative Testing - Invalid credential handling

Target Application

πŸš€ Quick Start

Prerequisites

  • Java 11 or higher
  • Maven 3.6+
  • Chrome/Firefox browser

Installation

git clone https://github.com/Naveen-Ravichandran003/Naveen_DemoProject1.git
cd Naveen_DemoProject1
mvn clean install

Execution Options

1. Run Tests with TestNG

# Run all tests using TestNG suite
mvn clean test

# Headless mode (CI/CD)
mvn test -Dheadless=true

2. Generate Reports

# Generate Allure report
mvn allure:report

# Start Allure live server
mvn allure:serve

Report Access

After execution, reports are available at:

  • Cucumber HTML: target/cucumber-html-reports/report.html
  • TestNG HTML: target/testng-html-report.html
  • Allure Report: target/site/allure-maven-plugin/index.html
  • Screenshots: test-screenshots/

πŸ“Š CI/CD Integration

πŸ€” Why Use CI/CD Integration?

πŸ”„ Continuous Quality Assurance

  • Automatic testing on every code change
  • Catch bugs early before they reach production
  • Prevent broken code from being merged

πŸš€ Professional Development Practices

  • Industry standard - Expected in enterprise environments
  • Team collaboration - Multiple developers can work safely
  • Code confidence - Know immediately if changes break tests

πŸ“Š Automated Reporting

  • Test results available instantly after each run
  • Historical tracking - See test trends over time
  • Visual evidence - Screenshots and reports stored automatically

🏒 Enterprise Requirements

  • Compliance - Many organizations require automated testing
  • Deployment gates - Tests must pass before releases
  • Documentation - Audit trail of all test executions

GitHub Actions Workflow

  • βœ… Automated Testing - Runs on every push and pull request
  • βœ… Cross-Platform - Ubuntu environment with headless Chrome
  • βœ… Report Generation - Automatic Allure, Cucumber, and TestNG reports
  • βœ… Artifact Storage - Test results and screenshots saved for 90 days
  • βœ… Status Badges - Real-time build status visibility

Workflow Triggers

  • Push to main or Naveen_Demo branches
  • Pull requests to these branches
  • Manual workflow dispatch

Pipeline Steps

  1. Environment Setup - Java 11, Maven, Chrome
  2. Dependency Caching - Faster builds with Maven cache
  3. Test Execution - Headless Selenium tests
  4. Report Generation - Allure and Cucumber reports
  5. Artifact Upload - Reports and screenshots storage

Viewing Results

Pipeline Configuration

# Example GitHub Actions
- name: Run Tests
  run: mvn clean test -Dheadless=true

- name: Generate Reports
  run: mvn allure:report

πŸ”§ Configuration

Browser Settings

  • Default: Chrome (headed mode)
  • Headless: Set headless=true system property
  • Firefox: Modify DriverManager.java

Test Data

  • Feature Files: src/test/resources/features/
  • Test Properties: src/test/resources/cucumber.properties
  • Allure Config: src/test/resources/allure.properties

πŸ“ˆ Project Metrics

Framework Statistics

  • Total Files: 15+ automation files
  • Code Coverage: Page Object Model implementation
  • Test Scenarios: 3 comprehensive test cases (positive, negative, workflow)
  • Reporting Formats: 3 different report types
  • Execution Mode: Sequential with fresh browser sessions

Quality Assurance

  • βœ… Page Object Model - Maintainable code structure
  • βœ… BDD Implementation - Business-readable scenarios
  • βœ… Error Handling - Robust exception management
  • βœ… Screenshot Evidence - Visual test validation
  • βœ… Wait Strategies - Reliable element synchronization
  • βœ… TestNG Integration - Custom HTML report generation
  • βœ… Thread Safety - ThreadLocal WebDriver management
  • βœ… Fresh Sessions - Clean browser state per test

🀝 Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/new-test)
  3. Commit changes (git commit -am 'Add new test scenario')
  4. Push to branch (git push origin feature/new-test)
  5. Create Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ† Acknowledgments

  • Built with Amazon Q Developer AI assistance
  • Implements industry best practices for test automation
  • Designed for enterprise-scale testing requirements
  • Optimized for both local development and CI/CD pipelines

Repository: https://github.com/Naveen-Ravichandran003/Naveen_DemoProject1
Branch: Naveen_Demo

Releases

No releases published

Packages

 
 
 

Contributors