I have two questions please : 1/ If we want to test two different tests, can we create two Java Steps classes to perform two different tests ? 2/ How to erase cookies and Refresh the page to test new data ? Thank you
-
Welcome to Stack Overflow. Please show your latest non-working attempt at solving this problem. It is usually more instructive to see fixes to your code than to read someone else's solution. See https://stackoverflow.com/help/how-to-ask – Spangen Jun 07 '18 at 10:12
1 Answers
question 1 (If we want to test two different tests, can we create two Java Steps classes to perform two different tests ?):
yes, you can, and it's even advisable. The Java part is coded like any java code (inheritance, ...). Here is an example on another project:
Here we have grouped the change password actions of the application into changePasswordSteps.java. The class XxxxxxxSteps.java is the first class generated by the CLI but later you can perfectly create others (and it is even recommended not to have all the steps of the same application in the same class). The steps form a functional division while the pages form a technical section (image of the target application). A step class can then use one or more pages. Just be careful that there are not many steps that match the same regex.
We must see the steps as a pool of features usable by the Gherkin part. Your unit tests can draw in the generic steps of the NoraUI framework but also in yours.
You can find more information on official documentation here.

- 11,140
- 10
- 85
- 154