Achieving the Fluent Page Object Design Pattern with Patrol Possible? #1746
RashmiShashindra
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am a user of Patrol for e2e integration tests in our product.
Currently, I am building a proper model to carry out the scripting tasks for the integration tests using Patrol. I was able to achieve the Page Object Model using the Patrol but my current goal is to achieve the the Fluent Page Object Model which supports the simplicity and the test method chaining.
But I get that the Patrol methods which are$.tap, $ .enterText and etc are all Future async methods which uses awaits to resolve the Promises. Because of this behavior, I am unable to achieve the Fluent pattern to simplify the tests.
I have tried Cascading in dart as well but it actually did not work and it has some promise resolving limitations when it comes to the test method chaining. Issue
Below is my Fluent Implementation
Test with method chaining
Page Layer with the Methods to support Fluent (Without Future async and await)
Error that I get on the runtime is due to the unresolved promises. Where I need to make my methods also Future Async and usage of awaits.
@bartekpacia I would like to know if there is a way that I can use the Patrol methods and resolve the promises without awaits? Or do you have any solution already in place to achieve the Fluent Pattern?
Highly appreciate your support on this.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions