page-object 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +1 -0
  4. data/ChangeLog +10 -0
  5. data/README.md +1 -1
  6. data/features/bold.feature +21 -0
  7. data/features/html/indexed_property.html +14 -0
  8. data/features/html/multi_elements.html +1 -1
  9. data/features/html/static_elements.html +1 -2
  10. data/features/indexed_property.feature +15 -0
  11. data/features/multi_elements.feature +6 -0
  12. data/features/step_definitions/async_steps.rb +1 -1
  13. data/features/step_definitions/bold_steps.rb +12 -0
  14. data/features/step_definitions/check_box_steps.rb +2 -2
  15. data/features/step_definitions/indexed_property_steps.rb +47 -1
  16. data/features/step_definitions/label_steps.rb +1 -1
  17. data/features/step_definitions/multi_elements_steps.rb +13 -0
  18. data/features/step_definitions/select_list_steps.rb +1 -1
  19. data/features/step_definitions/table_steps.rb +4 -0
  20. data/features/support/page.rb +9 -0
  21. data/features/table.feature +12 -4
  22. data/lib/page-object.rb +6 -5
  23. data/lib/page-object/accessors.rb +78 -58
  24. data/lib/page-object/elements.rb +1 -0
  25. data/lib/page-object/elements/bold.rb +11 -0
  26. data/lib/page-object/elements/element.rb +12 -1
  27. data/lib/page-object/elements/table.rb +12 -1
  28. data/lib/page-object/indexed_properties.rb +20 -21
  29. data/lib/page-object/javascript/angularjs.rb +14 -0
  30. data/lib/page-object/javascript_framework_facade.rb +4 -2
  31. data/lib/page-object/locator_generator.rb +1 -0
  32. data/lib/page-object/page_populator.rb +0 -1
  33. data/lib/page-object/platforms/selenium_webdriver/button.rb +1 -1
  34. data/lib/page-object/platforms/selenium_webdriver/element.rb +1 -1
  35. data/lib/page-object/platforms/selenium_webdriver/page_object.rb +26 -10
  36. data/lib/page-object/platforms/selenium_webdriver/radio_button.rb +0 -7
  37. data/lib/page-object/platforms/watir_webdriver/element.rb +1 -1
  38. data/lib/page-object/platforms/watir_webdriver/page_object.rb +23 -8
  39. data/lib/page-object/platforms/watir_webdriver/radio_button.rb +0 -7
  40. data/lib/page-object/version.rb +1 -1
  41. data/lib/page-object/widgets.rb +7 -0
  42. data/page-object.gemspec +3 -3
  43. data/spec/page-object/accessors_spec.rb +40 -0
  44. data/spec/page-object/element_locators_spec.rb +340 -305
  45. data/spec/page-object/elements/area_spec.rb +8 -8
  46. data/spec/page-object/elements/bold_spec.rb +29 -0
  47. data/spec/page-object/elements/button_spec.rb +7 -7
  48. data/spec/page-object/elements/canvas_spec.rb +6 -6
  49. data/spec/page-object/elements/check_box_spec.rb +9 -9
  50. data/spec/page-object/elements/div_spec.rb +3 -3
  51. data/spec/page-object/elements/element_spec.rb +21 -21
  52. data/spec/page-object/elements/file_field_spec.rb +4 -4
  53. data/spec/page-object/elements/form_spec.rb +3 -3
  54. data/spec/page-object/elements/heading_spec.rb +8 -8
  55. data/spec/page-object/elements/hidden_field_spec.rb +3 -3
  56. data/spec/page-object/elements/image_spec.rb +14 -14
  57. data/spec/page-object/elements/label_spec.rb +3 -3
  58. data/spec/page-object/elements/link_spec.rb +6 -6
  59. data/spec/page-object/elements/list_item_spec.rb +4 -3
  60. data/spec/page-object/elements/nested_element_spec.rb +47 -47
  61. data/spec/page-object/elements/option_spec.rb +1 -1
  62. data/spec/page-object/elements/ordered_list_spec.rb +33 -33
  63. data/spec/page-object/elements/paragraph_spec.rb +3 -4
  64. data/spec/page-object/elements/select_list_spec.rb +52 -52
  65. data/spec/page-object/elements/selenium/radio_button_spec.rb +7 -13
  66. data/spec/page-object/elements/selenium/text_field_spec.rb +7 -7
  67. data/spec/page-object/elements/selenium_element_spec.rb +53 -53
  68. data/spec/page-object/elements/span_spec.rb +3 -3
  69. data/spec/page-object/elements/table_cell_spec.rb +3 -3
  70. data/spec/page-object/elements/table_row_spec.rb +22 -22
  71. data/spec/page-object/elements/table_spec.rb +28 -28
  72. data/spec/page-object/elements/text_area_spec.rb +5 -5
  73. data/spec/page-object/elements/unordered_list_spec.rb +33 -34
  74. data/spec/page-object/elements/watir_element_spec.rb +47 -48
  75. data/spec/page-object/javascript_framework_facade_spec.rb +6 -6
  76. data/spec/page-object/loads_platform_spec.rb +4 -4
  77. data/spec/page-object/page-object_spec.rb +103 -102
  78. data/spec/page-object/page_factory_spec.rb +43 -61
  79. data/spec/page-object/page_populator_spec.rb +44 -50
  80. data/spec/page-object/platforms/selenium_webdriver/selenium_page_object_spec.rb +15 -15
  81. data/spec/page-object/platforms/selenium_webdriver_spec.rb +6 -6
  82. data/spec/page-object/platforms/watir_webdriver/watir_page_object_spec.rb +4 -4
  83. data/spec/page-object/platforms/watir_webdriver_spec.rb +1 -1
  84. data/spec/page-object/selenium_accessors_spec.rb +166 -153
  85. data/spec/page-object/watir_accessors_spec.rb +265 -245
  86. data/spec/page-object/widget_spec.rb +62 -30
  87. data/spec/spec_helper.rb +8 -8
  88. metadata +20 -10
@@ -8,14 +8,14 @@ describe PageObject::Elements::Area do
8
8
  it "should map watir types to same" do
9
9
  [:class, :id, :index, :name, :xpath].each do |t|
10
10
  identifier = area.watir_identifier_for t => 'value'
11
- identifier.keys.first.should == t
11
+ expect(identifier.keys.first).to eql t
12
12
  end
13
13
  end
14
14
 
15
15
  it "should map selenium types to same" do
16
16
  [:class, :id, :index, :name, :xpath].each do |t|
17
17
  key, value = area.selenium_identifier_for t => 'value'
18
- key.should == t
18
+ expect(key).to eql t
19
19
  end
20
20
  end
21
21
  end
@@ -27,18 +27,18 @@ describe PageObject::Elements::Area do
27
27
  let(:selenium_area) { PageObject::Elements::Area.new(area_element, :platform => :selenium_webdriver) }
28
28
 
29
29
  it "should know its coords" do
30
- area_element.should_receive(:attribute).with(:coords).and_return("1,2,3,4")
31
- selenium_area.coords.should == "1,2,3,4"
30
+ expect(area_element).to receive(:attribute).with(:coords).and_return("1,2,3,4")
31
+ expect(selenium_area.coords).to eql "1,2,3,4"
32
32
  end
33
33
 
34
34
  it "should know its shape" do
35
- area_element.should_receive(:attribute).with(:shape).and_return('circle')
36
- selenium_area.shape.should == 'circle'
35
+ expect(area_element).to receive(:attribute).with(:shape).and_return('circle')
36
+ expect(selenium_area.shape).to eql 'circle'
37
37
  end
38
38
 
39
39
  it "should know its href" do
40
- area_element.should_receive(:attribute).with(:href).and_return('twitter.com')
41
- selenium_area.href.should == 'twitter.com'
40
+ expect(area_element).to receive(:attribute).with(:href).and_return('twitter.com')
41
+ expect(selenium_area.href).to eql 'twitter.com'
42
42
  end
43
43
  end
44
44
  end
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+ require 'page-object/elements'
3
+
4
+ describe PageObject::Elements::Bold do
5
+ let(:bold) { PageObject::Elements::Bold }
6
+
7
+ describe "when mapping how to find an element" do
8
+ it "should map watir types to same" do
9
+ [:class, :id, :index, :name, :xpath].each do |t|
10
+ identifier = bold.watir_identifier_for t => 'value'
11
+ expect(identifier.keys.first).to eql t
12
+ end
13
+ end
14
+
15
+ it "should map selenium types to same" do
16
+ [:class, :id, :index, :name, :xpath].each do |t|
17
+ key, value = bold.selenium_identifier_for t => 'value'
18
+ expect(key).to eql t
19
+ end
20
+ end
21
+ end
22
+
23
+ describe "interface" do
24
+
25
+ it "should register with tag :b" do
26
+ expect(::PageObject::Elements.element_class_for(:b)).to eql ::PageObject::Elements::Bold
27
+ end
28
+ end
29
+ end
@@ -8,14 +8,14 @@ describe PageObject::Elements::Button do
8
8
  it "should map watir types to same" do
9
9
  [:class, :id, :index, :name, :value, :xpath, :src, :alt, :css].each do |t|
10
10
  identifier = button.watir_identifier_for t => 'value'
11
- identifier.keys.first.should == t
11
+ expect(identifier.keys.first).to eql t
12
12
  end
13
13
  end
14
14
 
15
15
  it "should map selenium types to same" do
16
16
  [:class, :id, :index, :name, :value, :xpath, :src, :alt, :css].each do |t|
17
17
  key, value = button.selenium_identifier_for t => 'value'
18
- key.should == t
18
+ expect(key).to eql t
19
19
  end
20
20
  end
21
21
  end
@@ -24,25 +24,25 @@ describe PageObject::Elements::Button do
24
24
  let(:button_element) { double('button_element') }
25
25
 
26
26
  it "should register with type :submit" do
27
- ::PageObject::Elements.element_class_for(:input, :submit).should == ::PageObject::Elements::Button
27
+ expect(::PageObject::Elements.element_class_for(:input, :submit)).to eql ::PageObject::Elements::Button
28
28
  end
29
29
 
30
30
  it "should register with type :image" do
31
- ::PageObject::Elements.element_class_for(:input, :image).should == ::PageObject::Elements::Button
31
+ expect(::PageObject::Elements.element_class_for(:input, :image)).to eql ::PageObject::Elements::Button
32
32
  end
33
33
 
34
34
  it "should register with type :button" do
35
- ::PageObject::Elements.element_class_for(:input, :button).should == ::PageObject::Elements::Button
35
+ expect(::PageObject::Elements.element_class_for(:input, :button)).to eql ::PageObject::Elements::Button
36
36
  end
37
37
 
38
38
  it "should retisger with type :reset" do
39
- ::PageObject::Elements.element_class_for(:input, :reset).should == ::PageObject::Elements::Button
39
+ expect(::PageObject::Elements.element_class_for(:input, :reset)).to eql ::PageObject::Elements::Button
40
40
  end
41
41
 
42
42
  context "for selenium" do
43
43
  it "should return error when asked for its' text" do
44
44
  button = PageObject::Elements::Button.new(button_element, :platform => :selenium_webdriver)
45
- lambda { button.text }.should raise_error
45
+ expect(lambda { button.text }).to raise_error
46
46
  end
47
47
  end
48
48
  end
@@ -8,14 +8,14 @@ describe PageObject::Elements::Canvas do
8
8
  it "should map watir types to same" do
9
9
  [:class, :id, :index, :name, :xpath].each do |t|
10
10
  identifier = area.watir_identifier_for t => 'value'
11
- identifier.keys.first.should == t
11
+ expect(identifier.keys.first).to eql t
12
12
  end
13
13
  end
14
14
 
15
15
  it "should map selenium types to same" do
16
16
  [:class, :id, :index, :name, :xpath].each do |t|
17
17
  key, value = area.selenium_identifier_for t => 'value'
18
- key.should == t
18
+ expect(key).to eql t
19
19
  end
20
20
  end
21
21
  end
@@ -27,13 +27,13 @@ describe PageObject::Elements::Canvas do
27
27
  let(:selenium_canvas) { PageObject::Elements::Canvas.new(canvas_element, :platform => :selenium_webdriver) }
28
28
 
29
29
  it "should know its width" do
30
- canvas_element.should_receive(:attribute).with(:width).and_return("400")
31
- selenium_canvas.width.should == 400
30
+ expect(canvas_element).to receive(:attribute).with(:width).and_return("400")
31
+ expect(selenium_canvas.width).to eql 400
32
32
  end
33
33
 
34
34
  it "should know its height" do
35
- canvas_element.should_receive(:attribute).with(:height).and_return("100")
36
- selenium_canvas.height.should == 100
35
+ expect(canvas_element).to receive(:attribute).with(:height).and_return("100")
36
+ expect(selenium_canvas.height).to eql 100
37
37
  end
38
38
  end
39
39
  end
@@ -8,13 +8,13 @@ describe PageObject::Elements::CheckBox do
8
8
  it "should map watir types to same" do
9
9
  [:class, :id, :index, :name, :xpath, :value].each do |t|
10
10
  identifier = checkbox.watir_identifier_for t => 'value'
11
- identifier.keys.first.should == t
11
+ expect(identifier.keys.first).to eql t
12
12
  end
13
13
  end
14
14
  it "should map selenium types to same" do
15
15
  [:class, :id, :name, :xpath, :index, :value].each do |t|
16
16
  key, value = checkbox.selenium_identifier_for t => 'value'
17
- key.should == t
17
+ expect(key).to eql t
18
18
  end
19
19
  end
20
20
  end
@@ -24,25 +24,25 @@ describe PageObject::Elements::CheckBox do
24
24
  let(:selenium_cb) { PageObject::Elements::CheckBox.new(check_box, :platform => :selenium_webdriver) }
25
25
 
26
26
  it "should register with type :checkbox" do
27
- ::PageObject::Elements.element_class_for(:input, :checkbox).should == ::PageObject::Elements::CheckBox
27
+ expect(::PageObject::Elements.element_class_for(:input, :checkbox)).to eql ::PageObject::Elements::CheckBox
28
28
  end
29
29
 
30
30
  context "for selenium" do
31
31
  it "should check" do
32
- check_box.should_receive(:click)
33
- check_box.should_receive(:selected?).and_return(false)
32
+ expect(check_box).to receive(:click)
33
+ expect(check_box).to receive(:selected?).and_return(false)
34
34
  selenium_cb.check
35
35
  end
36
36
 
37
37
  it "should uncheck" do
38
- check_box.should_receive(:click)
39
- check_box.should_receive(:selected?).and_return(true)
38
+ expect(check_box).to receive(:click)
39
+ expect(check_box).to receive(:selected?).and_return(true)
40
40
  selenium_cb.uncheck
41
41
  end
42
42
 
43
43
  it "should know if it is checked" do
44
- check_box.should_receive(:selected?).and_return(true)
45
- selenium_cb.should be_checked
44
+ expect(check_box).to receive(:selected?).and_return(true)
45
+ expect(selenium_cb).to be_checked
46
46
  end
47
47
  end
48
48
  end
@@ -8,20 +8,20 @@ describe PageObject::Elements::Div do
8
8
  it "should map watir types to same" do
9
9
  [:class, :id, :text, :index, :xpath, :name, :title, :css].each do |t|
10
10
  identifier = div.watir_identifier_for t => 'value'
11
- identifier.keys.first.should == t
11
+ expect(identifier.keys.first).to eql t
12
12
  end
13
13
  end
14
14
 
15
15
  it "should map selenium types to same" do
16
16
  [:class, :id, :text, :index, :name, :xpath, :title, :css].each do |t|
17
17
  key, value = div.selenium_identifier_for t => 'value'
18
- key.should == t
18
+ expect(key).to eql t
19
19
  end
20
20
  end
21
21
 
22
22
  describe "interface" do
23
23
  it "should register with tag :div" do
24
- ::PageObject::Elements.element_class_for(:div).should == ::PageObject::Elements::Div
24
+ expect(::PageObject::Elements.element_class_for(:div)).to eql ::PageObject::Elements::Div
25
25
  end
26
26
  end
27
27
  end
@@ -9,7 +9,7 @@ describe "Element" do
9
9
  ['table', 'span', 'div', 'td', 'li', 'ol', 'ul'].each do |tag|
10
10
  how = {:tag_name => tag, :name => 'blah'}
11
11
  result = PageObject::Elements::Element.watir_identifier_for how
12
- result[:xpath].should == ".//#{tag}[@name='blah']"
12
+ expect(result[:xpath]).to eql ".//#{tag}[@name='blah']"
13
13
  end
14
14
  end
15
15
  end
@@ -27,8 +27,8 @@ describe "Element" do
27
27
  all_basic_elements.each do |tag|
28
28
  identifier = {:tag_name => tag, :index => 1}
29
29
  how, what = PageObject::Elements::Element.selenium_identifier_for identifier
30
- how.should == :xpath
31
- what.should == "(.//#{tag})[2]"
30
+ expect(how).to eql :xpath
31
+ expect(what).to eql "(.//#{tag})[2]"
32
32
  end
33
33
  end
34
34
 
@@ -36,8 +36,8 @@ describe "Element" do
36
36
  all_input_elements.each do |tag|
37
37
  identifier = {:tag_name => 'input', :type => tag, :index => 1}
38
38
  how, what = PageObject::Elements::Element.selenium_identifier_for identifier
39
- how.should == :xpath
40
- what.should include "(.//input[@type='#{tag}'])[2]"
39
+ expect(how).to eql :xpath
40
+ expect(what).to include "(.//input[@type='#{tag}'])[2]"
41
41
  end
42
42
  end
43
43
 
@@ -45,8 +45,8 @@ describe "Element" do
45
45
  all_basic_elements.each do |tag|
46
46
  identifier = {:tag_name => tag, :name => 'blah', :index => 0}
47
47
  how, what = PageObject::Elements::Element.selenium_identifier_for identifier
48
- how.should == :xpath
49
- what.should == "(.//#{tag}[@name='blah'])[1]"
48
+ expect(how).to eql :xpath
49
+ expect(what).to eql "(.//#{tag}[@name='blah'])[1]"
50
50
  end
51
51
  end
52
52
 
@@ -54,8 +54,8 @@ describe "Element" do
54
54
  all_input_elements.each do |type|
55
55
  identifier = {:tag_name => 'input', :type => "#{type}", :name => 'blah', :index => 0}
56
56
  how, what = PageObject::Elements::Element.selenium_identifier_for identifier
57
- how.should == :xpath
58
- what.should include "(.//input[@type='#{type}' and @name='blah'])[1]"
57
+ expect(how).to eql :xpath
58
+ expect(what).to include "(.//input[@type='#{type}' and @name='blah'])[1]"
59
59
  end
60
60
  end
61
61
 
@@ -63,8 +63,8 @@ describe "Element" do
63
63
  all_basic_elements.each do |tag|
64
64
  identifier = {:tag_name => tag, :class => 'bar', :name => 'foo'}
65
65
  how, what = PageObject::Elements::Element.selenium_identifier_for identifier
66
- how.should == :xpath
67
- what.should == ".//#{tag}[@class='bar' and @name='foo']"
66
+ expect(how).to eql :xpath
67
+ expect(what).to eql ".//#{tag}[@class='bar' and @name='foo']"
68
68
  end
69
69
  end
70
70
 
@@ -72,7 +72,7 @@ describe "Element" do
72
72
  all_input_elements.each do |type|
73
73
  identifier = {:tag_name => 'input', :type => "#{type}", :class => 'bar', :name => 'foo'}
74
74
  how, what = PageObject::Elements::Element.selenium_identifier_for identifier
75
- what.should include ".//input[@type='#{type}' and @class='bar' and @name='foo']"
75
+ expect(what).to include ".//input[@type='#{type}' and @class='bar' and @name='foo']"
76
76
  end
77
77
  end
78
78
  end
@@ -82,33 +82,33 @@ describe "Element" do
82
82
  let(:element) { PageObject::Elements::Element.new(native, :platform => :watir_webdriver) }
83
83
 
84
84
  it "should check if native is enabled" do
85
- native.should_receive(:enabled?).and_return(true)
86
- element.should be_enabled
85
+ expect(native).to receive(:enabled?).and_return(true)
86
+ expect(element).to be_enabled
87
87
  end
88
88
 
89
89
  it "should click the native" do
90
- native.should_receive(:click)
90
+ expect(native).to receive(:click)
91
91
  element.click
92
92
  end
93
93
 
94
94
  it "should double click the native" do
95
- native.should_receive(:double_click)
95
+ expect(native).to receive(:double_click)
96
96
  element.double_click
97
97
  end
98
98
 
99
99
  it "should inspect the native" do
100
- native.should_receive(:inspect)
100
+ expect(native).to receive(:inspect)
101
101
  element.inspect
102
102
  end
103
103
 
104
104
  it "should retrieve the native's style" do
105
- native.should_receive(:style).with('foo').and_return("cheezy_style")
106
- element.style('foo').should == 'cheezy_style'
105
+ expect(native).to receive(:style).with('foo').and_return("cheezy_style")
106
+ expect(element.style('foo')).to eql 'cheezy_style'
107
107
  end
108
108
 
109
109
  it "should know if a native is disabled" do
110
- native.should_receive(:enabled?).and_return(false)
111
- element.should be_disabled
110
+ expect(native).to receive(:enabled?).and_return(false)
111
+ expect(element).to be_disabled
112
112
  end
113
113
  end
114
114
  end
@@ -9,14 +9,14 @@ describe PageObject::Elements::FileField do
9
9
  it "should map watir types to same" do
10
10
  [:class, :id, :index, :name, :xpath, :title].each do |t|
11
11
  identifier = filefield.watir_identifier_for t => 'value'
12
- identifier.keys.first.should == t
12
+ expect(identifier.keys.first).to eql t
13
13
  end
14
14
  end
15
15
 
16
16
  it "should map selenium types to same" do
17
17
  [:class, :id, :index, :name, :xpath, :title].each do |t|
18
18
  key, value = filefield.selenium_identifier_for t => 'value'
19
- key.should == t
19
+ expect(key).to eql t
20
20
  end
21
21
  end
22
22
  end
@@ -25,13 +25,13 @@ describe PageObject::Elements::FileField do
25
25
  let(:filefield) { double('file_field') }
26
26
 
27
27
  it "should register as type :file" do
28
- ::PageObject::Elements.element_class_for(:input, :file).should == ::PageObject::Elements::FileField
28
+ expect(::PageObject::Elements.element_class_for(:input, :file)).to eql ::PageObject::Elements::FileField
29
29
  end
30
30
 
31
31
  context "for selenium" do
32
32
  it "should set its' value" do
33
33
  selenium_file_field = PageObject::Elements::FileField.new(filefield, :platform => :selenium_webdriver)
34
- filefield.should_receive(:send_keys).with('a file')
34
+ expect(filefield).to receive(:send_keys).with('a file')
35
35
  selenium_file_field.value = 'a file'
36
36
  end
37
37
  end
@@ -6,13 +6,13 @@ describe PageObject::Elements::Form do
6
6
  let(:form_element) { double('form_element') }
7
7
 
8
8
  it "should register with tag_name :form" do
9
- ::PageObject::Elements.element_class_for(:form).should == ::PageObject::Elements::Form
9
+ expect(::PageObject::Elements.element_class_for(:form)).to eql ::PageObject::Elements::Form
10
10
  end
11
11
 
12
12
  context "for watir" do
13
13
  it "should submit a form" do
14
14
  form = PageObject::Elements::Form.new(form_element, :platform => :watir_webdriver)
15
- form_element.should_receive(:submit)
15
+ expect(form_element).to receive(:submit)
16
16
  form.submit
17
17
  end
18
18
  end
@@ -20,7 +20,7 @@ describe PageObject::Elements::Form do
20
20
  context "for selenium" do
21
21
  it "should submit a form" do
22
22
  form = PageObject::Elements::Form.new(form_element, :platform => :selenium_webdriver)
23
- form_element.should_receive(:submit)
23
+ expect(form_element).to receive(:submit)
24
24
  form.submit
25
25
  end
26
26
  end
@@ -8,41 +8,41 @@ describe PageObject::Elements::Heading do
8
8
  it "should map watir types to same" do
9
9
  [:class, :id, :index, :name, :xpath].each do |t|
10
10
  identifier = heading.watir_identifier_for t => 'value'
11
- identifier.keys.first.should == t
11
+ expect(identifier.keys.first).to eql t
12
12
  end
13
13
  end
14
14
 
15
15
  it "should map selenium types to same" do
16
16
  [:class, :id, :index, :name, :xpath].each do |t|
17
17
  key, value = heading.selenium_identifier_for t => 'value'
18
- key.should == t
18
+ expect(key).to eql t
19
19
  end
20
20
  end
21
21
  end
22
22
 
23
23
  describe "interface" do
24
24
  it "should register with tag :h1" do
25
- ::PageObject::Elements.element_class_for(:h1).should == ::PageObject::Elements::Heading
25
+ expect(::PageObject::Elements.element_class_for(:h1)).to eql ::PageObject::Elements::Heading
26
26
  end
27
27
 
28
28
  it "should register with tag :h2" do
29
- ::PageObject::Elements.element_class_for(:h2).should == ::PageObject::Elements::Heading
29
+ expect(::PageObject::Elements.element_class_for(:h2)).to eql ::PageObject::Elements::Heading
30
30
  end
31
31
 
32
32
  it "should register with tag :h3" do
33
- ::PageObject::Elements.element_class_for(:h3).should == ::PageObject::Elements::Heading
33
+ expect(::PageObject::Elements.element_class_for(:h3)).to eql ::PageObject::Elements::Heading
34
34
  end
35
35
 
36
36
  it "should register with tag :h4" do
37
- ::PageObject::Elements.element_class_for(:h4).should == ::PageObject::Elements::Heading
37
+ expect(::PageObject::Elements.element_class_for(:h4)).to eql ::PageObject::Elements::Heading
38
38
  end
39
39
 
40
40
  it "should register with tag :h5" do
41
- ::PageObject::Elements.element_class_for(:h5).should == ::PageObject::Elements::Heading
41
+ expect(::PageObject::Elements.element_class_for(:h5)).to eql ::PageObject::Elements::Heading
42
42
  end
43
43
 
44
44
  it "should register with tag :h6" do
45
- ::PageObject::Elements.element_class_for(:h6).should == ::PageObject::Elements::Heading
45
+ expect(::PageObject::Elements.element_class_for(:h6)).to eql ::PageObject::Elements::Heading
46
46
  end
47
47
  end
48
48
  end