-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Write up Playwright code style. #53170
Comments
In the next round of documentation update, include the following:
|
IMO, this is a good practice where the method name itself doesn't suggest the argument type/value. Here's an example where that applies (taken from some recent refactor): BAD await GutenbergEditorComponent.publish( true ); It's not immediately obvious what we're enabling here when passing GOOD await GutenbergEditorComponent.publish( { visit: true } ); Now we know that most probably, we're going to visit the published post/page. I don't think this would be good as a general rule as many times it's unnecessary or even unintuitive. For example, from this recent PR - |
@WunderBart I understand what you are saying and I think it's reasonable. I am not sure how we should codify this however. I suppose I can write this up like the following (paraphrased):
Or do you think that perhaps it's better off not including guidance on this at all? |
I think so, yeah. It's more of a general rule than one that would apply to the E2E code specifically. Let's skip it 👍 |
I think this is something that should depend on the context. I.e. for a page model, I'd use the Here's a wider example of this convention that made me realize the difference between page/screen & flow models (from https://youtu.be/-oPYQL42pGs?t=1752): |
Task Details
There is enough difference between the Playwright and Selenium frameworks that I think an update to the code style (including naming variables, etc) should be updated.
Related to
Parent: #52464
The text was updated successfully, but these errors were encountered: