新手问题 [求助] 如何在 rspec 中实现点击一个内容是图片的按钮?

lithium4010 · June 12, 2014 · Last by ugoa replied at June 12, 2014 · 1289 hits

正常比如删除按钮

click_button '删除'

如果这里删除是个图像应该怎么写测试?

可以这样:

image = page.find('css_selector') # To get the image
image.click
You need to Sign in before reply, if you don't have an account, please Sign up first.