-
Notifications
You must be signed in to change notification settings - Fork 237
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
[Feature] Add synchronous API #2715
Comments
Not ideal workaround (but I didn't come up with better solution) for chaining is to write Task extension, something like:
and then, in your POM class methods, you need to return Task so you can call something like this in test:
|
@wolvi19 |
Agreed. This is one of the reasons I'm hesitant to move from Selenium/C# and try Playwright/C#. I don't consider the API to be as well designed and the async-only is one of the major things. I have no use of async-methods, it just forces me to add a lot of "ugly" and irrelevant syntax/boiler-plate code to keep the test code synchronous - which it of course must be in 99% of the time. |
Same in our case. Async API does not play well with older sync codebases.. Much boilerplate code & tweaking is needed. |
The reasoning was pretty much covered in the following discussion thread: https://github.com/microsoft/playwright/discussions/26890
Async API doesn't bring many benefits in an automated testing context, but forces to add an additional syntax and prevents writing fluent PO classes
For example, with async API we can't have a fluent chain like
page1.ClickButton1().FillForm2().ValidateField3()
Instead, it'll be
The text was updated successfully, but these errors were encountered: