- Create .feature files describing your features and scenarios that provide examples of the behavior of those features.
- Implement step definitions for the steps in your scenarios
- Extract 'helper methods' that interact with your application via the Page Object pattern (if you are testing through the UI)
Ad 3. You might also want to distinguish 2 layers of helper methods:
3a. Actions that perform verification on your application (such as verify an element is visible, has a certain value, whatever)
3b. Interaction with your application via the Page Object pattern, which contain only the controls but have no opinion on whether the actual state is the expected state (as that is determined in your verification actions, see 3a)
You project setup (in Java) would be:
├── pom.xml* (containing our Cucumber and JUnit dependencies)
│ └── java (marked as sources root)
│ └── resources (marked as resources root)
├── java (marked as test sources root)
└── resources (marked as test resources root)
- pom.xml - assuming you are using Maven to import your dependencies, and JUnit to run your tests, your pom.xml should include the following dependencies to use Cucumber java:
(Disclaimer: I cannot advise on Ruby dependency management or structure as I don't use Ruby myself - but it should be something similar)
In addition, you will likely use Selenium to interact with your web pages.
For your consideration: if your intention is to test the internal business logic of the application, consider testing below the GUI - as testing through the UI tends to be slow and flaky.
Also, I highly recommend "The Cucumber for Java book" (if you will be using Java), or "The Cucumber book" (for Ruby).
You can also have a look at the https://github.com/cucumber/cucumber-java-skeleton project to get started with Cucumber java