Screenplay samples for inputs

335 views
Skip to first unread message

Mark Gargan

unread,
Jan 9, 2018, 7:12:16 AM1/9/18
to Serenity BDD Users Group
Hi folks,

Is there any comprehensive samples project out there? Something with a static page that loads with all of the basic html types being manipulated. 

Currently I've looked at the 

screenplay-pattern-todomvc
serenity-screenplay-train-demo (Think the website has been updated so that this project is now out of sync)

and I don't see any examples of handling radio buttons (can see it in PageObjects) via the screenplay framework nor alerts. 
this is pretty low level UI interaction which I think Screenplay's attempting to abstract us away from but we still need to be able to do it? 

To accept an alert for example I have the following code

BrowseTheWeb.as(theActorInTheSpotlight()).getDriver().switchTo().alert().accept();

however I don't see how to wrap this in a performable this isn't wrappable in a Performable or Task. 

I'm new to the Screenplay framework but have been working with Selenium & WebDriver for a long time.

I'm hoping there's a straightforward sample test suite that I've just completely missed in my research. 

Thanks,
Mark.

Mark Gargan

unread,
Jan 9, 2018, 12:37:32 PM1/9/18
to Serenity BDD Users Group
Hi there, 

          It looks like it's a case that if you start out by writing tests with PageObjects you'd probably come across this a lot sooner. 
Both functionality it turns out is available on the BrowseTheWeb specifically the PageObject class. 


For RadioButtons:
         BrowseTheWeb.as(actor).inRadioButtonGroup("radioGroupElementName").selectByValue("Y");

For Alerts:
        BrowseTheWeb.as(actor).getAlert().accept();

My mistake was thinking that the PageObject and Screenplay approaches were mutually exclusive and I started straight into the Screenplay approach without really going through PageObjects approach. 


Hope this helps someone else, 
Mark.
Reply all
Reply to author
Forward
0 new messages