Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to learn to code in the screen play pattern fast? #2417

Closed
SchnuckySchuster opened this issue Mar 22, 2021 · 5 comments
Closed

How to learn to code in the screen play pattern fast? #2417

SchnuckySchuster opened this issue Mar 22, 2021 · 5 comments
Labels

Comments

@SchnuckySchuster
Copy link

Hallo community,

this might be a stupid question, nevertheless:

For years I intend to learn to use the screen play pattern. I never got the hang of it so far.
Now I try again. I watch the you tube videos and I read the tutorials.
I can understand what I see and read.
In fact it feels beautiful, natural, inspiring, ... .

I just don't know how to get from reading something like this

then(anna).should(eventually(seeThat(TheWebPage.title(), containsString("BDD In Action"))));

to being able to write it my self.

How many people actually use the screen play pattern and if you happen to be one, how did you get there?
I started with the API documentation. My problem there is that I don't see much documentation there apart from the bare bone java doc.
But diving in to the API spec I learn that should(...) needs a consequence, but how to know what methods of what objects return what types of consequences?

I think I could try to get my hands on as much example code I can find and from there try to figure out things via trial and error.

The problem is I'm a consultant and I need to show my customer why it would be good for him to use the screen play pattern.
Currently I see lots of reasons why the screen play pattern is nice.
On the other hand if it takes lots of time to learn how to use this pattern because there is not much in terms of a detailed "how to transition from steps and pages to screen play" I see no business case.

What I've found so far are teasers that make appetite to use the screen play pattern.
What do I miss?

May be I'm just not a good enough java developer and for the good java developers the whereabouts of the screen play pattern is so obvious that there is no need for the kind of documentation I'm looking for.

On the other hand people who write automated tests are no expert developers, otherwise they would be developers not testers.

So am I to assume that the old "steps and pages" way to use Serenity is meant to be used by testers and the screen play pattern is meant to be used for real java developers?

I'd love to get the hang of the screen play pattern.
Help is much appreciated.

@wakaleo
Copy link
Member

wakaleo commented Mar 22, 2021

@SchnuckySchuster I've worked with lots of testers who have mastered the art of Screenplay. If you want to reach out to me directly (on LinkedIn or via https://serenitydojo.as.me/clarity-call) I'd be happy to give you some insight.

@SchnuckySchuster
Copy link
Author

SchnuckySchuster commented Mar 29, 2021 via email

@aspenboy
Copy link

@SchnuckySchuster I've been using serenity for almost 3 years now, and also trying to apply screenplay pattern where applicable. Questions and Consequences are a bit confusing at first. Right now I'm trying to stick to Ensure library, which is not perfect - but usually does the trick. To be honest - screenplay pattern looks nice, but it's a bit overrated. It's not easy to get into it and might actually lead to overengineering. As the documentation is not very detailed - you can try to study the questions implemented in serenity and try to apply similar approach in your case.

If you have more specific example then maybe we can think about the approach?

@SchnuckySchuster
Copy link
Author

@aspenboy Thanks for your response!
I want to use ScreenPlay in my current project. I have coded my tests via Page and Steps so far.
Somehow my test suites ended up quite messy and tests where not easy to maintain.
I put high hopes on the ScreenPlay pattern. It feels so elegant.
But I have no experience how good the test suite will end up and whether maintanance will be an issue or not.
I also think that the documentation or the lack there of is a big drawback.

Once I have some experiance and given I have time I would like to contribute to the documentation.
ScreenPlay looks nice to read but I got through lots of pain reprogramming my brain to be able to think in ScreenPlay.

I think I got the hang of it.

@globalworming
Copy link
Collaborator

i have a some example projects on github you can look up https://github.com/globalworming?tab=repositories&q=serenity

you can also meet me https://calendly.com/aw_calendly1/coffee and I'll show you around a browser automation project I did for an insurance company if that helps.

Regarding "how to get there".. i feel its pretty easy when you already have the requirements in a way that also mentions given/when/then style who does what why. In the mentioned project I subversively asked questions while grooming to get the requirements in a state where this is the case.

@wakaleo wakaleo closed this as completed Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants