I am using the Trix WYSIWYG editor in my app. For my capybara test: I want to fill in the editor.
I found the article: How to test basecamp's trip editor... which seemed promising. Unfortunately it keeps giving me this error:
Selenium::WebDriver::Error::ElementNotVisibleError: element not visible
So it appears that Capybara is finding the element ok, but it is just not interacting with it because Capybara must have some default setting to not interact with hidden/invisible elements.
After looking around I came upon this Stackoverflow question: Is it possible to interact with hidden elements with capybara.
From that post: I have already tried this:
def fill_in_trix_editor(id, value)
Capybara.ignore_hidden_elements = false
find(:xpath, "//*[@id='#{id}']").set(value)
Capybara.ignore_hidden_elements = true
end
As well as this:
def fill_in_trix_editor(id, value)
find(:xpath, "//*[@id='#{id}']", visible: false).set(value)
end
Any idea as to how I can get Capybara to fill in the editor? For what it is worth: I am using rails 5.1.1
and chromedriver=2.29.461585