Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 rspec 测试输入的标题/工具提示?
我没有测试工具提示,直到我注意到一些停止工作并且它没有被其他测试捕获。(必须添加一些东西,这样问题才会被接受)
怎么样:
find('#element-locator')['title'].should == 'Expected title'
您还可以查看 HTML 属性:
expect(page).to have_selector("<selector>[data-content='<content>']")