Skip to content

Conversation

@seanpdoyle
Copy link
Contributor

As of teamcapybara/capybara#2489 (April 14, 2021), Capybara supports calling #send_keys on the page (instead of a particular element).

Similarly, there is a global :focused filter that compares the node to the Document.activeElement.

These are both powered by a Driver#active_element method in drivers that support JavaScript.

This commit integrates Capybara::Cuprite::Driver to support both.

@seanpdoyle seanpdoyle force-pushed the focused-filter branch 2 times, most recently from af5a7a3 to 405517d Compare February 29, 2024 05:13
@seanpdoyle seanpdoyle force-pushed the focused-filter branch 3 times, most recently from 533fd70 to 03c3d08 Compare February 29, 2024 05:35
@seanpdoyle seanpdoyle changed the title Support Node#active_element and :focused filter Support Node#send_keys and :focused filter Feb 29, 2024
@seanpdoyle seanpdoyle changed the title Support Node#send_keys and :focused filter Support Driver#send_keys and :focused filter Feb 29, 2024
As of [teamcapybara/capybara#2489][] (April 14, 2021), Capybara supports
calling `#send_keys` on the page (instead of a particular element).

Similarly, there is a global `:focused` filter that compares the node to
the [Document.activeElement][].

These are both powered by a [Driver#active_element][] method in drivers
that support JavaScript.

This commit integrates `Capybara::Cuprite::Driver` to support both.

[teamcapybara/capybara#2489]: teamcapybara/capybara#2489
[Driver#active_element]: https://github.com/teamcapybara/capybara/blob/c0cbf4024c1abd48b0c22c2930e7b05af58ab284/lib/capybara/driver/base.rb#L62-L68
[Document.activeElement]: https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement
@seanpdoyle
Copy link
Contributor Author

@route could you please approve CI to execute?

@route
Copy link
Member

route commented Mar 1, 2024

Awesome, thanks Sean!

@route route merged commit c1c2e42 into rubycdp:main Mar 1, 2024
@seanpdoyle seanpdoyle deleted the focused-filter branch March 1, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants