Like anyone who is even remotely interested in Selenium, I too heard about the new emerging "Screenplay Pattern" (you can read about it here, or watch this talk) and took some time to consider it. My first reaction was "I think it's a bit silly, writing all of this for no gain at all", then "It looks like more overhead and duplication than I currently have with page-objects". And then I forgot about it.
In Selenium Conf UK (2016) Antony Marcano gave a talk about it which I watched just since it was well presented, and I wanted to see if I could figure out why is there so much fuss around this pattern. It turns out that the screenplay pattern is simply branded incorrectly, and presented as a (complex) solution to a problem that should be solved in a simpler manner. Apart from that, though, it is a really useful tool to have in my utility belt, after fixing the fundamental flaw it has, of course.
To put things simply - The screenplay pattern is not a good substitution for decent page-objects and, in fact, should co-exist with them.
If you read my previous posts about "page-objects are not enough" (pt.1, pt.2) then you might have noticed that I advocate for a layered infrastructure for your automation. Personally, I see three layers that are really needed (Alex Schladebeck is splitting it to 5 distinct layers, which might be a good idea, depending on your context). The three layers I need are: Tests, Business actions (or "flows") and atomic actions.
The atomic actions are stuff like "click on the 'next' button" or "select all users from the database" (In Alex's model, there's a lower level layer which will do "click on something" or "run this SQL query" - a layer very important if you have multiple technologies to drive your actions).
However, atomic actions are not really helpful for your day to day test, so the second layer is created - the business actions. Here you'll find stuff such as "add a new user", "change password" and so on. Business actions are the place to put the context knowledge in - today logging in requires a username and password. Tomorrow it might require an one-time-password sent by SMS. the business action is the place to invoke the specific atomic actions that compose the actual action (Again, in Alex's model, this is split into two layers - internal and external. I think it's nice that she made this distinction, I don't think it's crucial in my context).
Finally, there's the tests themselves - They should be calling the flows layer, and even though some atomic actions might be used for assertions, as a rule of thumb - test methods should not be calling atomic actions themselves. When it get's to UI actions, this rule is more strict - your test should not contain any selenium code or any page-objects (the same is true for any sort of technology you might be using to drive your UI).
As I hope it's easy to notice - the screenplay pattern fits very nicely to that middle layer. Clear business actions that hide the actual steps taken to perform them. I can think of no reason not to include page objects within the screenplay actions, thus separating "how do I interact with an element" from "which elements should I be interacting with?"
This brings me to another point that was touched upon in Anthony's talk - Bloated page objects should not exist.
By separating the responsibility (the "which" from the "how") , most of this is solved - a page object should contain only the elements in it and a way to interact with each element. Perhaps we might go as far as aggregating filling up an entire form, but anything more complex than "login" should be dealt with in the flows layer. By doing this and keeping the page-objects representing small pieces of the UI , no large classes are created, and the flows layer (where the screenplay pattern is really helpful) remains clean and without unnecessary duplication when two actions go through the same pages.