【发布时间】:2016-09-26 19:18:15
【问题描述】:
我正在寻找一种基于断言特定元素的存在来包含或排除特定it 块的方法。
背景:我有一个烟雾测试,查看元素部分的功能。我希望为附加功能添加更多测试,但仅如果页面上存在特定部分。
我的想法的伪代码:
describe 'Smoking sections' do
it 'runs test 1' do
# does stuff
end
it 'runs test 2' do
# does more stuff
end
# if foo_section.present? == true do
# run additional tests using `it` blocks
# else
# p "Section not present"
# end
it 'continues doing more tests like normal' do
# does additional tests
end
end
这种过滤方式可行吗?
【问题讨论】:
标签: rspec filtering watir-webdriver