spec/watirspec/elements/text_field_spec.rb in watir-6.11.0 vs spec/watirspec/elements/text_field_spec.rb in watir-6.12.0
- old
+ new
@@ -23,9 +23,20 @@
expect(browser.text_field(xpath: "//input[@id='new_user_email']")).to exist
expect(browser.text_field(label: "First name")).to exist
expect(browser.text_field(label: /(Last|First) name/)).to exist
expect(browser.text_field(label: 'Without for')).to exist
expect(browser.text_field(label: /Without for/)).to exist
+ expect(browser.text_field(label: 'With hidden text')).to exist
+ expect(browser.text_field(label: 'With text')).not_to exist
+ expect(browser.text_field(visible_label: 'With hidden text')).not_to exist
+ expect(browser.text_field(visible_label: 'With text')).to exist
+
+ # These will work after text is deprecated for visible_text
+ # expect(browser.text_field(label: /With hidden text/)).to exist
+ # expect(browser.text_field(label: /With text/)).not_to exist
+
+ expect(browser.text_field(visible_label: /With text/)).to exist
+ expect(browser.text_field(visible_label: /With hidden text/)).not_to exist
end
it "returns the first text field if given no args" do
expect(browser.text_field).to exist
end