0
我创建使用selenium-webdriver
自动化测试与Ruby
如何使用Ruby检查Selenium中是否包含某些元素?
所以我需要检查,如果我选择的元素中含有一种类单击后。 但我无法找到如何在Ruby
的方式。
这是我的规格文件 -
it 'Desktop Cart open When click Bag icon' do
desktop_open_cart_button = @driver.find_element(:css, '.profile-container .bag-container .icon-bag')
sleep 2
desktop_open_cart_button.click
cartlist_container = @driver.find_element(:css, '.cartlist-container')
expect(cartlist_container.has_class?('active')).to be_truthy
sleep 2
end
看起来我们没有has_class?
方法。 那么如何检查点击后我的element
是否包含类?
谢谢〜