This is a comprehensive UI automation test framework for CodeAtlas - an AI-powered GitHub repository analysis tool built using Selenium WebDriver, TestNG, and Java.
Live Application: https://codeatlas-frontend-khaki.vercel.app/
- Stack Detection - Automatically identifies technology stack
- Architecture Diagrams - Visual representation of code structure
- Module Mapping - Detailed module relationships
- Improvement Insights - AI-powered suggestions for code improvement
- Selenium WebDriver: 4.15.0
- TestNG: 7.8.1
- WebDriver Manager: 5.8.1 (Automatic driver management)
- Extent Reports: 5.1.1 (Professional HTML reporting)
- Java: 11+
- Maven: Build automation
codeatlas-ui-automation/
├── pom.xml # Maven configuration
├── testng.xml # TestNG suite configuration
├── src/test/java
│ ├── base/
│ │ ├── BaseTest.java # Base test class with setup/teardown
│ │ └── DriverFactory.java # WebDriver instantiation & management
│ │
│ ├── pages/
│ │ ├── HomePage.java # Home page locators & methods
│ │ ├── AnalysisPage.java # Analysis results page
│ │ └── GraphPage.java # Architecture graph page
│ │
│ ├── tests/
│ │ ├── SmokeTests.java # Basic functionality tests
│ │ ├── RepositoryAnalysisTests.java # Repository analysis tests
│ │ └── GraphTests.java # Graph interaction tests
│ │
│ ├── utils/
│ │ ├── ConfigReader.java # Configuration file reader
│ │ ├── WaitUtils.java # Explicit wait utilities
│ │ └── ScreenshotUtils.java # Screenshot capture utility
│ │
│ └── listeners/
│ └── TestListener.java # TestNG listener + Extent Reports
│
├── src/test/resources
│ ├── config.properties # Application configuration
│ └── testdata.json # Test data
│
└── test-output/
├── extent-report.html # Extent report (generated)
├── screenshots/ # Failed test screenshots
└── emailable-report.html # TestNG report
Basic functionality tests to verify the application loads correctly:
- Home page loads successfully
- Hero elements (title, subtitle) are visible
- Feature badges are displayed
- Suggested repositories are visible
- GitHub URL input field is accessible
- Analyze button is visible
Tests repository analysis functionality with real GitHub repositories:
- FastAPI (https://github.com/tiangolo/fastapi) - Python framework
- Java (https://github.com/SoumyashriSingha/taskManagerFS) - Java framework
- Node.js (https://github.com/ChaitanyaNirf/redis-client-tracking) - Node.js framework
Test scenarios:
- Analyze repository from URL
- Verify stack detection results
- Verify architecture analysis results
- Verify module mapping results
- Verify improvement suggestions
- Test with suggested repository buttons
- Test with multiple repositories (Data-driven tests)
Tests visualization and graph interaction:
- Architecture graph displays correctly
- Nodes and edges are present
- Zoom controls are functional (zoom in/out)
- Graph can be interacted with (drag and pan)
- Node details are accessible on click
- Java 11 or higher
- Maven 3.6+
- Chrome, Firefox, or Edge browser
-
Clone or navigate to the project
cd CodeAtlas-Selenium -
Install dependencies
mvn clean install
-
Run all tests
mvn test -
Run specific test class
mvn test -Dtest=SmokeTests mvn test -Dtest=RepositoryAnalysisTests mvn test -Dtest=GraphTests
-
Run with specific browser
mvn test -Dbrowser=firefox mvn test -Dbrowser=edge mvn test -Dbrowser=chrome # default
browser=chrome # chrome, firefox, edge
base.url=https://codeatlas-frontend-khaki.vercel.app/
implicit.wait=10 # seconds
explicit.wait=10 # seconds
screenshot.path=test-output/screenshots/Contains sample repositories and test users for data-driven tests.
mvn test -Dgroups=smokemvn test -DparallelMode=methods -DthreadCount=2mvn test
# Reports are generated at: test-output/extent-report.html-
Setup Phase
- Initialize WebDriver with WebDriver Manager
- Maximize browser window
- Navigate to application
-
Test Phase
- Enter GitHub repository URL
- Click Analyze button
- Wait for results to load
- Verify expected elements are displayed
-
Teardown Phase
- Capture screenshot on failure (via TestListener)
- Close browser
- Generate Extent Report
- Automatic driver download and setup
- No manual driver management needed
- Supports Chrome, Firefox, Edge, and other browsers
- Beautiful HTML test reports
- Screenshots for failed tests
- Test duration tracking
- Pass/Fail/Skip statistics
- System information capture
- Centralized locator management
- Reusable methods for common actions
- Easy maintenance and scalability
- Uses WebDriverWait instead of Thread.sleep()
- Waits for elements to be clickable, visible, or disappear
- Reduces flakiness
- Title and subtitle: XPath with text matching
- Input field: CSS Selector for GitHub URL
- Buttons: XPath with contains() for flexible matching
- Feature badges: XPath with specific text
- Results container: XPath with class names
- Section headers: XPath with h2 tags
- Loading spinner: Class-based XPath
- Graph container: XPath for SVG/Canvas elements
- Nodes: XPath for circle or group elements
- Zoom controls: XPath with button text
Solution: Check internet connection, clear Maven cache
mvn clean install -USolution: Increase wait time in WaitUtils.java or check if elements exist in DOM
Solution: Ensure test-output/screenshots/ directory exists and is writable
- name: Run Selenium Tests
run: mvn test -Dbrowser=chrome
- name: Upload Reports
if: always()
uses: actions/upload-artifact@v2
with:
name: Test Reports
path: test-output/All dependencies are managed by Maven:
- Selenium WebDriver 4.15.0
- TestNG 7.8.1
- WebDriver Manager 5.8.1
- Extent Reports 5.1.1
- Commons IO 2.13.0
- Log4j 1.2.17
✅ Page Object Model - Locators centralized in page classes ✅ Explicit Waits - Prevents timing issues ✅ ThreadLocal for WebDriver - Thread-safe driver management ✅ Parametrized Tests - Data-driven testing ✅ Screenshot on Failure - Easier debugging ✅ Extent Reports - Professional test reporting ✅ Base Test Class - DRY principle ✅ Listener Integration - Automated report generation
To add new tests:
- Create page object in
pages/directory - Add test class in
tests/directory - Follow naming conventions and documentation
- Ensure all locators are properly validated
Soumyashri Singha
MIT License