Tests: TypeScript Β· Playwright Β· Cucumber
Academic Project: Software Testing Course - THWS University
Author: Aditya Cherukuru
Topic: Automated Acceptance Testing & Reporting
An automated acceptance testing and reports framework for OpenCart e-commerce platform that replaces manual testing with reliable, fast, and consistent automated tests. Built using modern tools like Playwright and Cucumber.js with BDD methodology.
| Technology | Purpose | Why I Chose It |
|---|---|---|
| Playwright | Browser automation | Modern, fast, multi-browser support |
| Cucumber.js | BDD framework | Business-readable test scenarios |
| TypeScript | Programming language | Type safety and better maintainability |
| Node.js | Runtime environment | Rich ecosystem and easy setup |
- Node.js 18+
- XAMPP (for OpenCart)
- Git
# Install XAMPP and start Apache + MySQL
# Download OpenCart to C:\xampp\htdocs\opencart\
# Complete OpenCart installation at http://localhost/opencart/git clone <your-repo-url>
cd opencart-acceptance-testing
npm install
npx playwright installnpm test- User Registration & Login β Account creation and authentication
- Product Search & Filtering β Search functionality with sorting options
- Shopping Cart Management β Add, update, remove items
- Checkout Process β Guest and registered user checkout flows
- Form Validation β Input validation and error handling
- β Total Scenarios: 18
- β Passed: 17 (94%)
- β Failed: 1 (6%)
- β±οΈ Execution Time: ~5 minutes
- π Browsers: Chrome, Firefox, Safari
npm test # Run all tests (visible browser)
npm run test:headless # Run in headless mode (faster)
npm run test:chrome
npm run test:firefox
npm run test:safari
npm run test:debug # Debug mode (slower execution)npx cucumber-js features/checkout-process.feature
npx cucumber-js --tags "@smoke"
npx cucumber-js features/user-registration.feature:15npm run report
npm run report:open- π Execution Summary β Pass/fail statistics
- πΌοΈ Screenshots β Automatic capture on failures
- β±οΈ Performance Metrics β Step execution timing
- π Browser Information β Cross-browser results
- π Detailed Logs β Step-by-step execution details
opencart-acceptance-testing/
βββ features/ # BDD test scenarios
βββ step-definitions/ # Test step implementations
βββ page-objects/ # Page Object Model classes
βββ test-data/ # Test data and fixtures
βββ utils/ # Helper functions
βββ screenshots/ # Failure screenshots
βββ cucumber-reports/ # JSON reports and Generated HTML Reports
export class CheckoutPage extends BasePage {
private readonly emailField = this.page.locator('input[name="email"]')
private readonly continueButton = this.page.locator('input[value="Continue"]')
async fillBillingDetails(customer: CustomerData): Promise<void> {
await this.emailField.fill(customer.email)
await this.waitForElement(this.continueButton)
}
}Feature: Checkout Process
Scenario: Complete guest checkout
Given I have products in my cart
When I proceed to checkout as guest
And I fill in billing information
And I select shipping method
And I choose payment method
Then I should see order confirmation| Metric | Manual Testing | Automated Testing | Improvement |
|---|---|---|---|
| Execution Time | 2-3 hours | 5 minutes | 96% faster |
| Browser Coverage | 1 browser | 3+ browsers | 3x coverage |
| Consistency | Variable | 100% consistent | No human error |
- Start Small β Begin with most critical scenarios
- Invest in Maintenance β Keep tests updated with application changes
- Team Training β Ensure team understands BDD methodology
- Proper Error Handling β Robust tests with good debugging
- CI/CD Integration
- API Testing
- Performance Testing
- Mobile Testing
- Visual Regression Testing
Includes solutions for:
- Product search failures
- Browser not launching
- Reports not generating
- Checkout failures
- Database connection issues
- Timeout errors
- Screenshot failures
Before running tests:
- Apache + MySQL running (XAMPP)
- OpenCart accessible via
http://localhost/opencart/ - Required products added
- Search works manually
- Playwright browsers installed
| Library | Version | Purpose | License | Source |
|---|---|---|---|---|
| Playwright | 1.44.0 | Browser automation | Apache-2.0 | GitHub |
| Cucumber.js | 10.8.0 | BDD framework (Gherkin) | MIT | GitHub |
| Winston | 3.13.0 | Logging | MIT | GitHub |
| csv-parse | 5.5.6 | CSV file parsing | BSD-3-Clause | GitHub |
| dotenv | 16.4.5 | Environment variable support | BSD-2-Clause | GitHub |
-
Page Object Model Pattern
Source: Playwright POM Guide
Used in:page-objects/
Modifications: Custom waits, OpenCart-specific methods -
Cucumber Hooks
Source: Cucumber Docs
Used in:hooks/hooks.ts
Modifications: Screenshot capture, browser context management -
GitHub Actions Workflow
Source: Playwright CI Docs
Used in:.github/workflows/acceptance-tests.yml
Modifications: Multi-browser matrix, artifact archiving
- Tool: ChatGPT-4
- Purpose: Class design, logging integration, documentation
- Extent: 20% (structural scaffolding, prompt help)
-
Browser Manager Class
- Prompt: "Create a TypeScript browser manager with error handling"
- My Modifications: Logging integration, screenshot logic
-
Step Definitions
- Tool: GitHub Copilot
- Contribution: Auto-complete suggestions
- My Work: Business logic, validations, wait strategies
| Package | Version | Purpose | License |
|---|---|---|---|
| @cucumber/cucumber | ^10.8.0 | BDD framework | MIT |
| @playwright/test | ^1.44.0 | Test automation | Apache-2.0 |
| winston | ^3.13.0 | Logging | MIT |
| csv-parse | ^5.5.6 | Test data parsing | BSD-3-Clause |
| dotenv | ^16.4.5 | Env config | BSD-2-Clause |
| Package | Version | Purpose | License |
|---|---|---|---|
| typescript | ^5.4.5 | Type-checking | Apache-2.0 |
| ts-node | ^10.9.2 | Run TS files | MIT |
| @types/node | ^20.14.2 | Type definitions | MIT |
- Independent: All tests can run in isolation
- Repeatable: Same input β same output
- Fast Feedback: All tests < 5 min
- Maintainable: POM abstraction layer
- Element not found β Smart retries
- Browser crash β Restart mechanism
- Missing data β Dynamic fixture creation
- Timeouts β Custom timeouts per feature
Created for educational use as part of the Software Testing course at THWS University.
Aditya Cherukuru β Developer & Test Architect
- Complete implementation and architecture
- Page Object Model and BDD test design
- Playwright + Cucumber.js integration
- Reporting, debugging, and documentation
Course: Software Testing β THWS University
Submission Date: 22 June 2025