1
테이블의 두 번째 항목에 대한 페이지에서 '삭제'링크를 선택하려는 시나리오가 있습니다. click_link_within을 보았거나 내부에서 사용하고 있지만 제대로 작동하지 않습니다. 여기 오이 webrat 두 번째 클릭 링크 삭제
Scenario: User deletes a staff member from the listing
Given a staff exists with name: "Michael"
And a staff exists with name: "Joe"
And I am on the listing staff index page
When I follow "Delete" for row containing "Joe"
Then I should be on the listing staff index page
And I should not see "Joe"
And I should see "Michael"
내가 사용하는 노력하고있어 단계 :
When /^I follow "([^"]*)" for row containing "([^"]*)"$/ do |button, text|
click_link_within "//*[.//td[contains(.,#{text})]]", button
end
그리고 여기 HAML의 목록 코드 :
%h1 Staff Listing
%table
%th Username
%th Surname
%th First Name
- @staff.each do |staff|
%tr
%td= staff.username
%td= staff.surname
%td= staff.firstname
%td= link_to "Edit", edit_staff_path(staff)
%td= link_to "Delete", staff, :method => :delete
카피 바라가 설치되어 있고 삭제 링크를 클릭 할 수 있지만 두 번째 링크는 클릭 할 수 없습니다. – map7
Capybara가 설치되어 있지만 오이에서 webrat 대신 사용해야합니다 (루비 스크립트/무언가를 설치 한 후에 https://github.com/aslakhellesoy/cucumber-rails를 참조하십시오/오이 생성 --capybara) . 삭제 링크를 클릭 할 수 있지만 두 번째 링크는 클릭 할 수 없다는 것은 무엇을 의미합니까? 나는 이해하지 못한다. – wrtsprt
내가 말하는 것은 직원 목록을 가지고 있으며 목록에있는 각 직원에 대한 삭제 링크가 있습니다. 가능하다면 오이가 두 번째 삭제 링크를 클릭하도록하고 싶습니다. – map7