我正在为一组向上箭头(div)编写测试,这些箭头会改变输入值,但根据数值的不同会略有不同。我正在编写测试以确保它正常工作,但似乎只能使用find(“div [id ='up-arrow-div']”)。点击之前的内部。有没有办法在里面点击这个div?
代码原样:
describe "up-arrow all the way down" do
before do
find("div[id='up-arrow-div']").click
end
it "should increase the input value by 5 if you click the up-arrow button" do
find_field('amount').value.should eq "95"
end
end
我喜欢的代码:
describe "up-arrow all the way down" do
it "should increase the input value by 5 if you click the up-arrow button" do
find("div[id='up-arrow-div']").click
find_field('amount').value.should eq "95"
end
end