watir 6.9.1 → 6.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +8 -0
  3. data/lib/watir/capabilities.rb +2 -2
  4. data/lib/watir/elements/element.rb +5 -3
  5. data/lib/watir/elements/iframe.rb +2 -2
  6. data/lib/watir/exception.rb +0 -1
  7. data/lib/watir/locators/button/locator.rb +3 -10
  8. data/lib/watir/locators/button/validator.rb +1 -1
  9. data/lib/watir/locators/cell/locator.rb +3 -5
  10. data/lib/watir/locators/element/locator.rb +61 -105
  11. data/lib/watir/locators/element/selector_builder.rb +11 -4
  12. data/lib/watir/locators/row/locator.rb +3 -5
  13. data/lib/watir/locators/text_field/locator.rb +2 -13
  14. data/spec/browser_spec.rb +4 -3
  15. data/spec/element_locator_spec.rb +50 -19
  16. data/spec/locator_spec_helper.rb +1 -1
  17. data/spec/spec_helper.rb +1 -1
  18. data/spec/watirspec/elements/area_spec.rb +0 -4
  19. data/spec/watirspec/elements/button_spec.rb +0 -4
  20. data/spec/watirspec/elements/checkbox_spec.rb +0 -4
  21. data/spec/watirspec/elements/dd_spec.rb +0 -4
  22. data/spec/watirspec/elements/del_spec.rb +0 -4
  23. data/spec/watirspec/elements/div_spec.rb +30 -8
  24. data/spec/watirspec/elements/divs_spec.rb +1 -1
  25. data/spec/watirspec/elements/dl_spec.rb +0 -4
  26. data/spec/watirspec/elements/dt_spec.rb +0 -4
  27. data/spec/watirspec/elements/element_spec.rb +25 -12
  28. data/spec/watirspec/elements/elements_spec.rb +11 -0
  29. data/spec/watirspec/elements/em_spec.rb +0 -4
  30. data/spec/watirspec/elements/filefield_spec.rb +0 -4
  31. data/spec/watirspec/elements/form_spec.rb +0 -4
  32. data/spec/watirspec/elements/frame_spec.rb +0 -4
  33. data/spec/watirspec/elements/hidden_spec.rb +0 -4
  34. data/spec/watirspec/elements/hn_spec.rb +0 -4
  35. data/spec/watirspec/elements/iframe_spec.rb +0 -4
  36. data/spec/watirspec/elements/image_spec.rb +0 -4
  37. data/spec/watirspec/elements/ins_spec.rb +0 -4
  38. data/spec/watirspec/elements/label_spec.rb +0 -4
  39. data/spec/watirspec/elements/li_spec.rb +0 -4
  40. data/spec/watirspec/elements/link_spec.rb +2 -5
  41. data/spec/watirspec/elements/links_spec.rb +1 -1
  42. data/spec/watirspec/elements/map_spec.rb +0 -4
  43. data/spec/watirspec/elements/ol_spec.rb +4 -6
  44. data/spec/watirspec/elements/option_spec.rb +0 -13
  45. data/spec/watirspec/elements/p_spec.rb +0 -4
  46. data/spec/watirspec/elements/pre_spec.rb +0 -4
  47. data/spec/watirspec/elements/radio_spec.rb +0 -4
  48. data/spec/watirspec/elements/select_list_spec.rb +4 -6
  49. data/spec/watirspec/elements/span_spec.rb +2 -5
  50. data/spec/watirspec/elements/spans_spec.rb +1 -1
  51. data/spec/watirspec/elements/strong_spec.rb +0 -4
  52. data/spec/watirspec/elements/table_spec.rb +6 -6
  53. data/spec/watirspec/elements/tbody_spec.rb +0 -5
  54. data/spec/watirspec/elements/td_spec.rb +2 -5
  55. data/spec/watirspec/elements/text_field_spec.rb +0 -4
  56. data/spec/watirspec/elements/tfoot_spec.rb +0 -5
  57. data/spec/watirspec/elements/thead_spec.rb +0 -5
  58. data/spec/watirspec/elements/tr_spec.rb +0 -4
  59. data/spec/watirspec/elements/ul_spec.rb +2 -5
  60. data/spec/watirspec/html/multiple_ids.html +1 -0
  61. data/spec/watirspec/html/non_control_elements.html +6 -1
  62. data/spec/watirspec/radio_set_spec.rb +0 -4
  63. data/watir.gemspec +1 -1
  64. metadata +2 -4
  65. data/spec/watirspec/html/ng_attributes.html +0 -59
@@ -26,10 +26,6 @@ describe "Em" do
26
26
  it "raises TypeError when 'what' argument is invalid" do
27
27
  expect { browser.em(id: 3.14).exists? }.to raise_error(TypeError)
28
28
  end
29
-
30
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
31
- expect { browser.em(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
32
- end
33
29
  end
34
30
 
35
31
  # Attribute methods
@@ -40,10 +40,6 @@ describe "FileField" do
40
40
  it "raises TypeError when 'what' argument is invalid" do
41
41
  expect { browser.file_field(id: 3.14).exists? }.to raise_error(TypeError)
42
42
  end
43
-
44
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
45
- expect { browser.file_field(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
46
- end
47
43
  end
48
44
 
49
45
  # Attribute methods
@@ -43,10 +43,6 @@ describe "Form" do
43
43
  it "raises TypeError when 'what' argument is invalid" do
44
44
  expect { browser.form(id: 3.14).exists? }.to raise_error(TypeError)
45
45
  end
46
-
47
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
48
- expect { browser.form(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
49
- end
50
46
  end
51
47
 
52
48
  describe "#submit" do
@@ -67,10 +67,6 @@ describe "Frame" do
67
67
  it "raises TypeError when 'what' argument is invalid" do
68
68
  expect { browser.frame(id: 3.14).exists? }.to raise_error(TypeError)
69
69
  end
70
-
71
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
72
- expect { browser.frame(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
73
- end
74
70
  end
75
71
 
76
72
  it "raises UnknownFrameException when accessing elements inside non-existing frame" do
@@ -43,10 +43,6 @@ describe "Hidden" do
43
43
  it "raises TypeError when 'what' argument is invalid" do
44
44
  expect { browser.hidden(id: 3.14).exists? }.to raise_error(TypeError)
45
45
  end
46
-
47
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
48
- expect { browser.hidden(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
49
- end
50
46
  end
51
47
 
52
48
  # Attribute methods
@@ -34,10 +34,6 @@ describe ["H1", "H2", "H3", "H4", "H5", "H6"] do
34
34
  it "raises TypeError when 'what' argument is invalid" do
35
35
  expect { browser.h1(id: 3.14).exists? }.to raise_error(TypeError)
36
36
  end
37
-
38
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
39
- expect { browser.h1(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
40
- end
41
37
  end
42
38
 
43
39
  # Attribute methods
@@ -97,10 +97,6 @@ describe "IFrame" do
97
97
  it "raises TypeError when 'what' argument is invalid" do
98
98
  expect { browser.iframe(id: 3.14).exists? }.to raise_error(TypeError)
99
99
  end
100
-
101
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
102
- expect { browser.iframe(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
103
- end
104
100
  end
105
101
 
106
102
  it 'handles all locators for element which do not exist' do
@@ -36,10 +36,6 @@ describe "Image" do
36
36
  it "raises TypeError when 'what' argument is invalid" do
37
37
  expect { browser.image(id: 3.14).exists? }.to raise_error(TypeError)
38
38
  end
39
-
40
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
41
- expect { browser.image(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
42
- end
43
39
  end
44
40
 
45
41
  # Attribute methods
@@ -37,10 +37,6 @@ describe "Ins" do
37
37
  it "raises TypeError when 'what' argument is invalid" do
38
38
  expect { browser.ins(id: 3.14).exists? }.to raise_error(TypeError)
39
39
  end
40
-
41
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
42
- expect { browser.ins(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
43
- end
44
40
  end
45
41
 
46
42
  # Attribute methods
@@ -35,10 +35,6 @@ describe "Label" do
35
35
  it "raises TypeError when 'what' argument is invalid" do
36
36
  expect { browser.label(id: 3.14).exists? }.to raise_error(TypeError)
37
37
  end
38
-
39
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
40
- expect { browser.label(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
41
- end
42
38
  end
43
39
 
44
40
  describe "click" do
@@ -37,10 +37,6 @@ describe "Li" do
37
37
  it "raises TypeError when 'what' argument is invalid" do
38
38
  expect { browser.li(id: 3.14).exists? }.to raise_error(TypeError)
39
39
  end
40
-
41
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
42
- expect { browser.li(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
43
- end
44
40
  end
45
41
 
46
42
  # Attribute methods
@@ -37,7 +37,8 @@ describe "Link" do
37
37
  expect(browser.link(title: "no_such_title")).to_not exist
38
38
  expect(browser.link(title: /no_such_title/)).to_not exist
39
39
  expect(browser.link(text: "no_such_text")).to_not exist
40
- expect(browser.link(text: /no_such_text/i)).to_not exist
40
+ msg = /:text locator with RegExp values to find elements based on only visible text is deprecated. Use :visible_text instead./
41
+ expect { expect(browser.link(text: /no_such_text/i)).to_not exist }.to output(msg).to_stdout_from_any_process
41
42
  expect(browser.link(href: 'no_such_href')).to_not exist
42
43
  expect(browser.link(href: /no_such_href/)).to_not exist
43
44
  expect(browser.link(index: 1337)).to_not exist
@@ -47,10 +48,6 @@ describe "Link" do
47
48
  it "raises TypeError when 'what' argument is invalid" do
48
49
  expect { browser.link(id: 3.14).exists? }.to raise_error(TypeError)
49
50
  end
50
-
51
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
52
- expect { browser.link(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
53
- end
54
51
  end
55
52
 
56
53
  # Attribute methods
@@ -14,7 +14,7 @@ describe "Links" do
14
14
 
15
15
  describe "#length" do
16
16
  it "returns the number of links" do
17
- expect(browser.links.length).to eq 4
17
+ expect(browser.links.length).to eq 7
18
18
  end
19
19
  end
20
20
 
@@ -33,10 +33,6 @@ describe "Map" do
33
33
  it "raises TypeError when 'what' argument is invalid" do
34
34
  expect { browser.map(id: 3.14).exists? }.to raise_error(TypeError)
35
35
  end
36
-
37
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
38
- expect { browser.map(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
39
- end
40
36
  end
41
37
 
42
38
  # Attribute methods
@@ -23,7 +23,8 @@ describe "Ol" do
23
23
  expect(browser.ol(id: "no_such_id")).to_not exist
24
24
  expect(browser.ol(id: /no_such_id/)).to_not exist
25
25
  expect(browser.ol(text: "no_such_text")).to_not exist
26
- expect(browser.ol(text: /no_such_text/)).to_not exist
26
+ msg = /:text locator with RegExp values to find elements based on only visible text is deprecated. Use :visible_text instead./
27
+ expect { expect(browser.ol(text: /no_such_text/)).to_not exist }.to output(msg).to_stdout_from_any_process
27
28
  expect(browser.ol(class: "no_such_class")).to_not exist
28
29
  expect(browser.ol(class: /no_such_class/)).to_not exist
29
30
  expect(browser.ol(index: 1337)).to_not exist
@@ -34,7 +35,8 @@ describe "Ol" do
34
35
  expect(browser.ol(id: "no_such_id")).to_not exist
35
36
  expect(browser.ol(id: /no_such_id/)).to_not exist
36
37
  expect(browser.ol(text: "no_such_text")).to_not exist
37
- expect(browser.ol(text: /no_such_text/)).to_not exist
38
+ msg = /:text locator with RegExp values to find elements based on only visible text is deprecated. Use :visible_text instead./
39
+ expect { expect(browser.ol(text: /no_such_text/)).to_not exist }.to output(msg).to_stdout_from_any_process
38
40
  expect(browser.ol(class: "no_such_class")).to_not exist
39
41
  expect(browser.ol(class: /no_such_class/)).to_not exist
40
42
  expect(browser.ol(index: 1337)).to_not exist
@@ -44,10 +46,6 @@ describe "Ol" do
44
46
  it "raises TypeError when 'what' argument is invalid" do
45
47
  expect { browser.ol(id: 3.14).exists? }.to raise_error(TypeError)
46
48
  end
47
-
48
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
49
- expect { browser.ol(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
50
- end
51
49
  end
52
50
 
53
51
  # Attribute methods
@@ -64,11 +64,6 @@ describe "Option" do
64
64
  expect { browser.option(id: 3.14).exists? }.to raise_error(TypeError)
65
65
  expect { browser.select_list(name: "new_user_country").option(id: 3.14).exists? }.to raise_error(TypeError)
66
66
  end
67
-
68
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
69
- expect { browser.option(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
70
- expect { browser.select_list(name: "new_user_country").option(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
71
- end
72
67
  end
73
68
 
74
69
  describe "#select" do
@@ -103,14 +98,6 @@ describe "Option" do
103
98
  expect { browser.select_list(name: "new_user_country").option(text: "no_such_text").select }.to raise_unknown_object_exception
104
99
  expect { browser.select_list(name: "new_user_country").option(text: /missing/).select }.to raise_unknown_object_exception
105
100
  end
106
-
107
- it "raises MissingWayOfFindingObjectException when given a bad 'how' (page context)" do
108
- expect { browser.option(missing: "Denmark").select }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
109
- end
110
-
111
- it "raises MissingWayOfFindingObjectException when given a bad 'how' (select_list context)" do
112
- expect { browser.select_list(name: "new_user_country").option(missing: "Denmark").select }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
113
- end
114
101
  end
115
102
 
116
103
  describe "#class_name" do
@@ -37,10 +37,6 @@ describe "P" do
37
37
  it "raises TypeError when 'what' argument is invalid" do
38
38
  expect { browser.p(id: 3.14).exists? }.to raise_error(TypeError)
39
39
  end
40
-
41
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
42
- expect { browser.p(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
43
- end
44
40
  end
45
41
 
46
42
  # Attribute methods
@@ -37,10 +37,6 @@ describe "Pre" do
37
37
  it "raises TypeError when 'what' argument is invalid" do
38
38
  expect { browser.pre(id: 3.14).exists? }.to raise_error(TypeError)
39
39
  end
40
-
41
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
42
- expect { browser.pre(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
43
- end
44
40
  end
45
41
 
46
42
  # Attribute methods
@@ -66,10 +66,6 @@ describe "Radio" do
66
66
  it "raises TypeError when 'what' argument is invalid" do
67
67
  expect { browser.radio(id: 3.14).exists? }.to raise_error(TypeError)
68
68
  end
69
-
70
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
71
- expect { browser.radio(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
72
- end
73
69
  end
74
70
 
75
71
  # Attribute methods
@@ -31,7 +31,8 @@ describe "SelectList" do
31
31
  expect(browser.select_list(value: 'no_such_value')).to_not exist
32
32
  expect(browser.select_list(value: /no_such_value/)).to_not exist
33
33
  expect(browser.select_list(text: 'no_such_text')).to_not exist
34
- expect(browser.select_list(text: /no_such_text/)).to_not exist
34
+ msg = /:text locator with RegExp values to find elements based on only visible text is deprecated. Use :visible_text instead./
35
+ expect { expect(browser.select_list(text: /no_such_text/)).to_not exist }.to output(msg).to_stdout_from_any_process
35
36
  expect(browser.select_list(class: 'no_such_class')).to_not exist
36
37
  expect(browser.select_list(class: /no_such_class/)).to_not exist
37
38
  expect(browser.select_list(index: 1337)).to_not exist
@@ -41,10 +42,6 @@ describe "SelectList" do
41
42
  it "raises TypeError when 'what' argument is invalid" do
42
43
  expect { browser.select_list(id: 3.14).exists? }.to raise_error(TypeError)
43
44
  end
44
-
45
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
46
- expect { browser.select_list(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
47
- end
48
45
  end
49
46
 
50
47
  # Attribute methods
@@ -265,7 +262,8 @@ describe "SelectList" do
265
262
 
266
263
  it "selects an option with a Regexp" do
267
264
  browser.select_list(name: "new_user_languages").clear
268
- browser.select_list(name: "new_user_languages").select(/1|3/)
265
+ msg = /Selecting Multiple Options with #select is deprecated\. Use #select_all instead/
266
+ expect { browser.select_list(name: "new_user_languages").select(/1|3/) }.to output(msg).to_stdout_from_any_process
269
267
  expect(browser.select_list(name: "new_user_languages").selected_options.map(&:text)).to eq %w[Danish NO]
270
268
  end
271
269
  end
@@ -27,7 +27,8 @@ describe "Span" do
27
27
  expect(browser.span(id: "no_such_id")).to_not exist
28
28
  expect(browser.span(id: /no_such_id/)).to_not exist
29
29
  expect(browser.span(text: "no_such_text")).to_not exist
30
- expect(browser.span(text: /no_such_text/)).to_not exist
30
+ msg = /:text locator with RegExp values to find elements based on only visible text is deprecated. Use :visible_text instead./
31
+ expect { expect(browser.span(text: /no_such_text/)).to_not exist }.to output(msg).to_stdout_from_any_process
31
32
  expect(browser.span(class: "no_such_class")).to_not exist
32
33
  expect(browser.span(class: /no_such_class/)).to_not exist
33
34
  expect(browser.span(index: 1337)).to_not exist
@@ -37,10 +38,6 @@ describe "Span" do
37
38
  it "raises TypeError when 'what' argument is invalid" do
38
39
  expect { browser.span(id: 3.14).exists? }.to raise_error(TypeError)
39
40
  end
40
-
41
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
42
- expect { browser.span(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
43
- end
44
41
  end
45
42
 
46
43
  # Attribute methods
@@ -14,7 +14,7 @@ describe "Spans" do
14
14
 
15
15
  describe "#length" do
16
16
  it "returns the number of spans" do
17
- expect(browser.spans.length).to eq 6
17
+ expect(browser.spans.length).to eq 7
18
18
  end
19
19
  end
20
20
 
@@ -37,10 +37,6 @@ describe "Strong" do
37
37
  it "raises TypeError when 'what' argument is invalid" do
38
38
  expect { browser.strong(id: 3.14).exists? }.to raise_error(TypeError)
39
39
  end
40
-
41
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
42
- expect { browser.strong(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
43
- end
44
40
  end
45
41
 
46
42
  # Attribute methods
@@ -34,10 +34,6 @@ describe "Table" do
34
34
  it "raises TypeError when 'what' argument is invalid" do
35
35
  expect { browser.table(id: 3.14).exists? }.to raise_error(TypeError)
36
36
  end
37
-
38
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
39
- expect { browser.table(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
40
- end
41
37
  end
42
38
 
43
39
  # Other
@@ -107,12 +103,16 @@ describe "Table" do
107
103
 
108
104
  it "finds rows belonging to this table" do
109
105
  expect(table.row(id: "outer_last")).to exist
110
- expect(table.row(text: /Table 1, Row 1, Cell 1/)).to exist
106
+ msg = /:text locator with RegExp values to find elements based on only visible text is deprecated. Use :visible_text instead./
107
+ expect { expect(table.row(text: /Table 1, Row 1, Cell 1/)).to exist }.to output(msg).to_stdout_from_any_process
111
108
  end
112
109
 
113
110
  it "does not find rows from a nested table" do
114
111
  expect(table.row(id: "inner_first")).to_not exist
115
- expect(table.row(text: /\ATable 2, Row 1, Cell 1 Table 2, Row 1, Cell 2\z/)).to_not exist
112
+ msg = /:text locator with RegExp values to find elements based on only visible text is deprecated. Use :visible_text instead./
113
+ expect do
114
+ expect(table.row(text: /\ATable 2, Row 1, Cell 1 Table 2, Row 1, Cell 2\z/)).to_not exist
115
+ end.to output(msg).to_stdout_from_any_process
116
116
  end
117
117
  end
118
118
 
@@ -43,11 +43,6 @@ describe "TableBody" do
43
43
  expect { browser.tbody(id: 3.14).exists? }.to raise_error(TypeError)
44
44
  expect { browser.table(index: 0).tbody(id: 3.14).exists? }.to raise_error(TypeError)
45
45
  end
46
-
47
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
48
- expect { browser.tbody(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
49
- expect { browser.table(index: 0).tbody(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
50
- end
51
46
  end
52
47
 
53
48
  bug "Safari does not strip text", :safari do
@@ -25,7 +25,8 @@ describe "TableCell" do
25
25
  expect(browser.td(id: 'no_such_id')).to_not exist
26
26
  expect(browser.td(id: /no_such_id/)).to_not exist
27
27
  expect(browser.td(text: 'no_such_text')).to_not exist
28
- expect(browser.td(text: /no_such_text/)).to_not exist
28
+ msg = /:text locator with RegExp values to find elements based on only visible text is deprecated. Use :visible_text instead./
29
+ expect { expect(browser.td(text: /no_such_text/)).to_not exist }.to output(msg).to_stdout_from_any_process
29
30
  expect(browser.td(index: 1337)).to_not exist
30
31
  expect(browser.td(xpath: "//td[@id='no_such_id']")).to_not exist
31
32
  end
@@ -33,10 +34,6 @@ describe "TableCell" do
33
34
  it "raises TypeError when 'what' argument is invalid" do
34
35
  expect { browser.td(id: 3.14).exists? }.to raise_error(TypeError)
35
36
  end
36
-
37
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
38
- expect { browser.td(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
39
- end
40
37
  end
41
38
 
42
39
  describe "#click" do
@@ -74,10 +74,6 @@ describe "TextField" do
74
74
  it "raises TypeError when 'what' argument is invalid" do
75
75
  expect { browser.text_field(id: 3.14).exists? }.to raise_error(TypeError)
76
76
  end
77
-
78
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
79
- expect { browser.text_field(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
80
- end
81
77
  end
82
78
 
83
79
  # Attribute methods
@@ -42,11 +42,6 @@ describe "TableFooter" do
42
42
  expect { browser.tfoot(id: 3.14).exists? }.to raise_error(TypeError)
43
43
  expect { browser.table(index: 0).tfoot(id: 3.14).exists? }.to raise_error(TypeError)
44
44
  end
45
-
46
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
47
- expect { browser.tfoot(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
48
- expect { browser.table(index: 0).tfoot(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
49
- end
50
45
  end
51
46
 
52
47
  describe "#[]" do
@@ -43,11 +43,6 @@ describe "TableHeader" do
43
43
  expect { browser.thead(id: 3.14).exists? }.to raise_error(TypeError)
44
44
  expect { browser.table(index: 0).thead(id: 3.14).exists? }.to raise_error(TypeError)
45
45
  end
46
-
47
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
48
- expect { browser.thead(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
49
- expect { browser.table(index: 0).thead(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
50
- end
51
46
  end
52
47
 
53
48
  describe "#[]" do
@@ -28,10 +28,6 @@ describe "TableRow" do
28
28
  it "raises TypeError when 'what' argument is invalid" do
29
29
  expect { browser.tr(id: 3.14).exists? }.to raise_error(TypeError)
30
30
  end
31
-
32
- it "raises MissingWayOfFindingObjectException when 'how' argument is invalid" do
33
- expect { browser.tr(no_such_how: 'some_value').exists? }.to raise_error(Watir::Exception::MissingWayOfFindingObjectException)
34
- end
35
31
  end
36
32
 
37
33
  describe "#click" do