Using JUnit Rule with Cucumber annotations

171 views
Skip to first unread message

Mark Winspear

unread,
May 1, 2015, 9:44:49 AM5/1/15
to cu...@googlegroups.com

Hi. I came across this thread because I am trying to put together a simple framework using a Page Object Model patten using Webdriver and using Cucumber as the BDD framework. I'm not a developer first and foremost, however I have taken the advice of Dave Haeffner in his book 'Selenium Guidebook for Java' in setting up a Base test class which uses JUnit's rule to set up an external resource and set capabilities then fire up a browser either locally or in saucelabs.

I have conflict between this and my cucumber annotations and cannot get the two to play nicely together when my base test class is extended by my SearchTestDefinitions class. I suspect that if the cucumber api supported JUnit rule, I would not get this issue (but as I say, I am not a developer by nature).

Any advice on how to combine the two if possible would be welcomed

The code is at https://github.com/markwinspear/SeleniumCucumberJavaBasicTest2

Many thanks
Mark

Jeff Jensen

unread,
May 1, 2015, 11:00:11 AM5/1/15
to cu...@googlegroups.com
I really like to use a framework called Serenity with Cucumber.  It has a lot of base setup for things we always do, including a good PageObject and wrapping WebDriver.  It also has great reporting.  Perhaps it will benefit you as well:


--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Mark Winspear

unread,
May 5, 2015, 3:40:52 AM5/5/15
to cu...@googlegroups.com
I really like to use a framework called Serenity with Cucumber.  It has a lot of base setup for things we always do, including a good PageObject and wrapping WebDriver.  It also has great reporting.  Perhaps it will benefit you as well:

Thanks very much Jeff. This looks interesting and I'll take a look and try it out, although I might struggle setting it up. I'd still really like to solve the original issue as it seems like i'm about 99% there with this being the final hurdle to having something simple and scalable
Reply all
Reply to author
Forward
0 new messages