0

I am totally new to cucumber, I am using page object model approach.

Let's say I have 3 page and 3 test classes

Ex: login Page.java / loginTest.java

Registration Page.java/Registration Test.java

ContactPage.java/ContactTest.java

Question(doubt): Do I need to create a 3 separate feature file? If not then how to do it?

1

Short and incomplete answer:

No, you don't. Technically, you can write how you want - the Cucumber engine just calls method based on steps regex, it doesn't deal with the Scenarios organization in files.

Long and deeper answer:

(Paste short answer here). Additionally, it is necessary to have a better understanding of the purpose of BDD and Page Objects.

Regarding BDD, I would point to Dan North's article and this post of
Aslak Hellesøy
and the article 3 misconceptions about BDD.

With the above-mentioned knowledge, one can understand that Page Objects is just a design pattern, completely unrelated to BDD and Cucumber. The techniques are often used together, but one needs always to justify its usage on a given project, not using it as a single silver-bullet tool out-of-the-box.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.