-
Notifications
You must be signed in to change notification settings - Fork 28
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
introduce intention revealing UI element specific helper functions #19
Comments
Actually, I realized that when writing #21 (comment) that this can be improved further: Instead of
it could be better to have
where |
So in other words there is a hierarchy:
|
This next-to-last-step of hierarchy (Page component, e.g. addressField) seems a nice thing to have but once it comes to implementation it starts backfiring. Namely, the desired pattern to be so: await addressField(page).enter(testData.address); but it is not clear at all what this part should do: addressField(page) ? Accumulate the arguments? always require a second method, like But the point is that awaiting each link in a chained call looks very cumbersome and it is so easy to introduce a mistake. Actually, the puppeteer's API already has nearly identical methods and they have all be await-ed, as the queue is called. Like so: await (await addressField(page)).enter(testData.address); I'll have to think over it before implementing it. Maybe something like this? await forAddressField(page, [
f => f.enter(text) // is awaited from the implementation
]); Thoughts? |
Yes. This is ugly
Sounds like
Sounds like in addition to |
…unctions: - page component helper methods
…unctions: - page component helper methods
The page object functions are written in terms of low level functions.
It would be better to introduce some helper functions.
This is a repeated pattern:
could be replaced by
The text was updated successfully, but these errors were encountered: