Skip to content

Commit e87c910

Browse files
committed
issue#229 update CHANGELOG.md/README.md due to select/selected methods changes
1 parent dcb368a commit e87c910

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ a block with this page, after which the page is closed.
1313
- `Ferrum::Browser` supports new option `:proxy` https://github.com/rubycdp/ferrum#proxy
1414
- `Ferrum::Network::Response#params` attr_reader added
1515
- `Ferrum::Node`
16-
- `#selected` check selected option
17-
- `#select` select option
16+
- `#selected` checks selected options. Returns an array of `Ferrum::Node` that's selected.
17+
- `#select` selects options by passed attribute, default: `:value`.
1818
- `#computed_style` returns hash of computed styles
1919
- `Ferrum::JavaScriptError#stack_trace` attr_reader
2020
- Windows support

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,20 @@ frame.at_css("//a[text() = 'Log in']") # => Node
11011101
#### selected : `Array<Node>`
11021102
#### select
11031103

1104+
(chainable) Selects options by passed attribute.
1105+
1106+
```ruby
1107+
browser.at_xpath("//*[select]").select(["1"]) # => Node (select)
1108+
browser.at_xpath("//*[select]").select(["text"], by: :text) # => Node (select)
1109+
```
1110+
1111+
Accept string, array or strings:
1112+
```ruby
1113+
browser.at_xpath("//*[select]").select("1")
1114+
browser.at_xpath("//*[select]").select("1", "2")
1115+
browser.at_xpath("//*[select]").select(["1", "2"])
1116+
```
1117+
11041118

11051119
## Thread safety ##
11061120

0 commit comments

Comments
 (0)