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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -