Scenarios only available on one form factor

11 views
Skip to first unread message

Harry King

unread,
May 13, 2016, 1:15:05 PM5/13/16
to Serenity BDD Users Group
Hi Guys,

I'm testing a site with a piece of functionality on the home page which is only visible to users on a desktop browser, it's hidden from mobile users to save space.  I've written a short story in JBehave which covers all the functionality on the home page, and want to skip this story when running the test on a mobile form factor.  Can I ask Serenity to skip the test without throwing an exception?

I've tried a couple of variations of:
@Given("not on mobile")
public void isUsingDesktopBrowser() {
if(deviceWidthIs(COMPUTER)) {
Serenity.ignoredStep("On mobile");
}
}

but that shows as an exception in both the test runner and the report.


I'm using Serenity 1.1.31


Reply all
Reply to author
Forward
0 new messages