lib/capybara/spec/session/selectors_spec.rb in capybara-3.8.2 vs lib/capybara/spec/session/selectors_spec.rb in capybara-3.9.0
- old
+ new
@@ -38,11 +38,21 @@
end
end
end
describe 'field selectors' do
- it 'can find specifically by id' do
- expect(@session.find(:field, id: 'customer_email').value).to eq 'ben@ben.com'
+ context 'with :id option' do
+ it 'can find specifically by id' do
+ expect(@session.find(:field, id: 'customer_email').value).to eq 'ben@ben.com'
+ end
+
+ it 'can find by regex' do
+ expect(@session.find(:field, id: /ustomer.emai/).value).to eq 'ben@ben.com'
+ end
+
+ it 'can find by case-insensitive id' do
+ expect(@session.find(:field, id: /StOmer.emAI/i).value).to eq 'ben@ben.com'
+ end
end
it 'can find specifically by name' do
expect(@session.find(:field, name: 'form[other_title]')['id']).to eq 'form_other_title'
end