This project demonstrates Acceptance Test Driven Development (ATDD) using Cucumber framework with LambdaTest cloud infrastructure for testing the LambdaTest E-Commerce Playground.
- Parallel test execution (3 concurrent threads)
- Professional SLF4J logging with Logback configuration
- Enhanced LambdaTest integration with automatic status reporting
- Unique test naming for easy dashboard identification
- Robust error handling for real-world scenarios (out-of-stock products)
- Page Object Model with reusable components
- Java JDK 21 or higher
- Maven 3.6+
- LambdaTest Account
- Sign up at LambdaTest
- Get credentials from LambdaTest Security Settings
-
Navigate to ATDD module:
cd atdd-guide
-
Set LambdaTest credentials (choose one method):
Option A: Environment Variables
export LT_USERNAME=your_username export LT_ACCESS_KEY=your_access_key
Option B: Maven System Properties (Recommended)
# Pass credentials directly with Maven command mvn verify -DLT_USERNAME=your_username -DLT_ACCESS_KEY=your_access_key
-
Install dependencies:
mvn clean install
atdd-guide/
├── src/main/java/com/lambdatest/atdd/
│ ├── config/ # Configuration classes
│ ├── core/ # WebDriver factory & utilities
│ └── pages/ # Page Object Model classes
├── src/test/java/com/lambdatest/atdd/
│ ├── context/ # Test context management
│ ├── hooks/ # Cucumber hooks
│ ├── runners/ # Test runners
│ └── steps/ # Step definitions
└── src/test/resources/features/ecommerce/
├── product-search.feature
└── shopping-cart.feature
# Run all tests (parallel) with credentials
mvn clean verify -DLT_USERNAME=your_username -DLT_ACCESS_KEY=your_access_key
# Run specific test suites
mvn verify -DLT_USERNAME=your_username -DLT_ACCESS_KEY=your_access_key -Dcucumber.filter.tags="@smoke"
mvn verify -DLT_USERNAME=your_username -DLT_ACCESS_KEY=your_access_key -Dcucumber.filter.tags="@critical"
mvn verify -DLT_USERNAME=your_username -DLT_ACCESS_KEY=your_access_key -Dcucumber.filter.tags="@regression"
# Using shell script
./run-atdd-tests.sh smoke
# Direct Cucumber CLI
java -cp "target/test-classes:target/classes:$(mvn dependency:build-classpath -q -Dmdep.outputFile=/dev/stdout)" io.cucumber.core.cli.Main --glue com.lambdatest.atdd --plugin pretty src/test/resources/features/ecommerce --tags "@ecommerce"
- Successful product search (iMac, HTC, Canon, Samsung, HP)
- Empty search handling
- No results scenarios
- Add product to cart with out-of-stock handling
- Cart functionality verification
- JavaScript click fallback for complex interactions
8 Scenarios (8 passed)
31 Steps (31 passed)
1m49s (parallel execution)
2025-08-25 05:11:29.253 [ForkJoinPool-1-worker-1] INFO c.l.atdd.core.WebDriverFactory - LambdaTest: Test marked as PASSED
2025-08-25 05:11:29.253 [ForkJoinPool-1-worker-1] INFO c.l.atdd.core.WebDriverFactory - LambdaTest Session: 41dbe58994649d3a0edf4411e52c088f
2025-08-25 05:11:29.253 [ForkJoinPool-1-worker-1] INFO c.l.atdd.core.WebDriverFactory - Dashboard: https://automation.lambdatest.com/build
cucumber.execution.parallel.enabled=true
cucumber.execution.parallel.config.fixed.parallelism=3
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<parallel>methods</parallel>
<threadCount>3</threadCount>
</configuration>
</plugin>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
Tests automatically report PASSED/FAILED status to LambdaTest dashboard with session tracking and direct links.
This ATDD implementation demonstrates production-ready acceptance testing with parallel execution and comprehensive cloud integration.