Check out the complete blog on this framework here: Click Here
This repository contains a test automation framework is built on Java, Winium, Cucumber for BDD, and Maven for managing dependencies and automation tasks. Java provides reliability, Winium facilitates seamless interaction with Windows applications, Cucumber supports BDD test creation for clear specifications, and Maven ensures a streamlined project structure and execution process. Together, these tools create an efficient and maintainable framework for desktop application testing.
- Leverages Java's strong typing to enhance code quality and maintainability.
- Integrates Winium for powerful and seamless interaction with Windows-based desktop applications.
- Implements Cucumber for creating natural language behavior-driven development tests, ensuring clear specifications and collaboration.
- Incorporates Cucumber's built-in reporting feature for easy visualization of test results, aiding in analysis and debugging.
- Offers a set of utility functions and pre-configured settings to handle common test scenarios efficiently, reducing development time.
- Utilizes Maven for managing dependencies and build processes, ensuring project scalability and ease of maintenance.
- Java
- JDK: 11.0.16
- Winium: 0.1.0-1
- Cucumber: 7.12.0
- testNG: 7.7.1
- cucumber-html-reporter: 6.0.0
- cucumber-core: 7.11.1
JDK- ^11.0.16
Winium - ^0.1.0-1
Java
Cucumber: ^7.12.0
cucumber-html-reporter- ^6.0.0
Behavior Driven Development (BDD)
Windows
Note:
Commands to clone and run the test cases
https://github.com/spurqlabs/Desktop-App-Winium-Java-Cucumber.git
This command clone this repository to your local VS code.
-
- To do so open the pom.xml file and right click go to maven and then select reload project.
- This step will install all the dependencies mentioned above.
- Make sure you have JDK installed on your system having version greater than 8
- The feature file contains the test scenarios described in Gherkin Language.
- The Scenarios are described in steps format using the keywords like Give, when, And, Then.
- Step definition files contain code that maps the steps in the feature file to automation code.
- The step definitions are responsible for interacting with the elements of the application and performing actions on them such as clicking, entering text, etc.
- The pages folder has the page object model of every feature file.
- The each file from the page folder is consists of the locators used to locate the webelements and the required actions performed to validate the functionality of the respective web elements.
- The folder is generally used to describe the methods that can be use more oftenly.
- The folder has logger file which is use to log the step results in the page file.
- In Cucumber, hooks are methods annotated with @Before and @After that run before and after each scenario.
- To ensure consistency between test environments, these hooks are used for setting up and taking down tests.
- The application can be initialized before and cleaned up after each scenario using hooks.
- The TestRunner class executes Cucumber tests with specified configuration settings, including the location of feature files, step definitions package, inclusion tags, and report generation plugins.
- The seamless integration of Cucumber tests into TestNG makes testing and reporting easy.
-
To execute the tests in the main branch of the repository you need to run the following command from the terminal:
-
This command runs all the tests from the project.
mvn test
-
This command first cleans the project (removes the target directory) and then runs the tests.
mvn clean test
-
This command runs tests with specific Cucumber tags.
mvn test “-Dcucumber.filter.tags=@tagName