Class: Capybara::Playwright::PageExtension::DialogAcceptor
- Inherits:
-
Object
- Object
- Capybara::Playwright::PageExtension::DialogAcceptor
- Defined in:
- lib/capybara/playwright/page.rb
Instance Method Summary collapse
- #handle(dialog) ⇒ Object
-
#initialize(dialog_type, options) ⇒ DialogAcceptor
constructor
A new instance of DialogAcceptor.
Constructor Details
#initialize(dialog_type, options) ⇒ DialogAcceptor
Returns a new instance of DialogAcceptor.
56 57 58 59 |
# File 'lib/capybara/playwright/page.rb', line 56 def initialize(dialog_type, ) @dialog_type = dialog_type @options = end |
Instance Method Details
#handle(dialog) ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/capybara/playwright/page.rb', line 61 def handle(dialog) if @dialog_type == :prompt dialog.accept_async(promptText: @options[:with] || dialog.default_value) else dialog.accept_async end end |