Sync API with block
Closed this issue · 0 comments
YusukeIwaki commented
Simple description about the feature
Provide sync API with block, like playwright-python. (ref: https://playwright.dev/python/docs/navigations#asynchronous-navigation)
page.wait_for_navigation do
page.click('#submit')
end
Usecase / Motivation
puppeteer-ruby provides async APIs.
await_all(
page.async_wait_for_navigation,
page.async_click('#submit'),
)
Async API would be familiar with JS users, but not so useful for Ruby users.
For example, async_click('#submit')
, async_press('Enter')
is not smart, not intuitive.
with_observing_something { click('#submit') }
with_observing_something { press('#submit') }
would be more useful for Ruby users, in such cases.