On an index page I have a table with a bunch of listed items. Each <tr></tr> within the table's <tbody>not only lists each item, but also allows you to
updatethat item- click
editto take you to the edit screen for that item
Here is a picture:
Within development in safari: I can successfully update each listed item and it all works just fine. However: when running my feature spec with capybara and selenium-webkit (which uses firefox):
- It appears that capybara finds the submit button ok and even clicks it
- But then nothing happens. For some reason the form appears to not be submitting when that update button is clicked.
To make things even more strange: in development mode while testing with firefox, clicking the update button works sometimes. Sometimes it doesn't work and I have to refresh the page, and then it works.
I tried putting a binding.pry in right before clicking the Update abc button in order to manually click the button at that step. I noticed that clicking the button manually was not submitting the form either.
Here is my relevant spec:
scenario "within the index page", js: true do
select 'some selection', from 'item_1_jazz'
select '12345', from 'item_1_something'
# I attempted putting a binding.pry here, and noticed that clicking the update button still wasn't submitting the form
find("#update_some_item_1_btn").click
expect(page).to have_content 'The item was successfully updated.'
end
Update Here are my buttons within the form:
<td class="btn-group">
<%= f.submit 'Update abc', class: "btn btn-success btn-sm", id: "update_#{dom_id(item)}_btn" %>
<%= link_to edit_item_path(item), class: "btn btn-info btn-sm" do %>
<i class="fa fa-pencil"></i> Edit
<% end %>
</td>
Question: In firefox: Capybara appears to find the submit button just fine and even click it. But why isn't Capybara able to submit the form within Firefox? Also: why in development mode with firefox does the button only work sometimes? It appears something is stopping the form form from submitting.

<form></form>? - Alekseybinding.pryin: Clicking the button does not work. - Neil"update_#{dom_id(item)}_btn"is exaclty equal to? - Alekseyclick_button(button_id)- Aleksey