A sample Test Automation Framework to understand and use cucumber-jvm
- Tests specified using cucumber-jvm
- Build tool: Gradle
- Programming language: Groovy (for Gradle) and Java
- Test Data Management: Samples to use data-specified in feature files, AND use data from separate json files
- Browser automation: Using WebDriver for browser interaction
- Web Service automation: Using cxf library to generate client code from web service WSDL files, and invoke methods on the same
- Take screenshots on demand and save on disk
- Integrated cucumber-reports to get 'pretty' and 'meaningful' reports from test execution
- Using apache logger for storing test logs in files (and also report to console)
- Using aspectJ to do byte code injection to automatically log test trace to file. Also creating a separate benchmarks file to track time taken by each method. This information can be mapped separately in other tools like Excel to identify patterns of test execution.
Gradle 1.11 - download from here. See installation steps here.
(You can use homebrew to install, or IntelliJ should be able to install for you)
JVM: 1.6.0_65 (Apple Inc. 20.65-b04-462)
OS: Mac OS X 10.9.1 x86_64
- Import the existing folder into IntelliJ and it should ask you to set your JDK and Gradle and you should be able to use IntelliJ.
- Once opened, you will want to install the 'Cucumber for Java' plugin from the Jetbrains repository which gives you syntax highlighting and ability to jump to steps.
All other dependent libraries are checked into the lib folder
gradle clean cucumber
Specify the Web Service name + WSDL url in the wsdlList method in build.gradle file
Run the command:
gradle clean buildWSClients
This command created Java classes for the specified WSDLs in the build/WebServiceClients directory
Once created, manually move these classes to the package of choice
- I have moved the curencyConvertor and the globalWeather clients to src/main/java/businessLayer package
Update the package in all the client files after moving them in the new location
Compile the code to ensure there is no file left from updating the package
Cucumber-html and junit reports are generated and available in
build/reports
For any information about this sample project, send an email to [email protected]