Full details below, but here's a summary of what happens on Chromedriver 91 headless only.
e = find("textarea#sometextareaid")
e.value # => nil
# and
e.native['_capybara_raw_value'] # => nil
# but
e.native.property(:value) # => "some value"
So this could be a bug in chromedriver, but capybara is doing some weird stuff with textarea values (native['_capybara_raw_value']) and I can't follow where this gets set on update, so it's possible it's a problem in capybara
Meta
Capybara Version:
capybara (3.35.3)
Driver Information (and browser if relevant):
selenium-webdriver (3.142.7) with Chrome 91.0.4472.77, chromedriver 91.0.4472.19
Additionally:
Nokogiri.respond_to?(:HTML5) && Capybara.allow_gumbo
=> false
This started happening when Chrome went from 90 -> 91 (on CI (ubuntu) as well as locally (MacOS)).
This only happens on chrome headless, not on chrome headed.
Setup
find("#sometextareaid").fill_in(with: "some value")`
expect(find("#sometextareaid").value).to eq("some value")
NB: I can validate that the current value is actually "some value" by creating a png screenshot with capybara-screenshot (either in a REPL, or in a line before the expect)
FYI also occurs with the following (just to rule out any timing issues)
find("#sometextareaid").fill_in(with: "some value")`
sleep(5)
expect(page).to have_field("sometextareaid", with: "some value")
Expected Behavior
expect to get the current value of the textarea
Actual Behavior
get nil always
Steps to reproduce
<textarea id="sometextareaid">
initial value
<textarea>
FYI I have only tested with a much more maximal version, and it's possible that there is some weird detail in the maximal version that is critical. However it's suddenly (post 91) happening for me across multiple tests, all to do with testing the values of different textareas in different contexts. If you require a realistic minimal repro, let me know.
Full details below, but here's a summary of what happens on Chromedriver 91 headless only.
So this could be a bug in chromedriver, but capybara is doing some weird stuff with textarea values (
native['_capybara_raw_value']) and I can't follow where this gets set on update, so it's possible it's a problem in capybaraMeta
Capybara Version:
capybara (3.35.3)
Driver Information (and browser if relevant):
Additionally:
This started happening when Chrome went from 90 -> 91 (on CI (ubuntu) as well as locally (MacOS)).
This only happens on chrome headless, not on chrome headed.
Setup
NB: I can validate that the current value is actually "some value" by creating a png screenshot with capybara-screenshot (either in a REPL, or in a line before the expect)
FYI also occurs with the following (just to rule out any timing issues)
Expected Behavior
expect to get the current value of the textarea
Actual Behavior
get nil always
Steps to reproduce
FYI I have only tested with a much more maximal version, and it's possible that there is some weird detail in the maximal version that is critical. However it's suddenly (post 91) happening for me across multiple tests, all to do with testing the values of different textareas in different contexts. If you require a realistic minimal repro, let me know.