Ruby - Capybara verifying parent class -
i have scenario if id "< prev" parent class must "disabled" , if id not ="< prev" parent class should not have "disabled"
<li class="disabled"> <a href="#" id="< prev"> prev </a> </li>
can me writing code using ruby, capybara
assuming you've found 'a' element , have in variable named link
if link[:id] == "< prev" expect(link).to match_selector("li.disabled > a") else expect(link).to match_selector("li:not(.disabled) > a") end
should verify specified
Comments
Post a Comment