page-object 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +10 -0
- data/features/hidden_field.feature +0 -2
- data/features/html/multi_elements.html +4 -0
- data/features/multi_elements.feature +139 -24
- data/features/step_definitions/multi_elements_steps.rb +108 -0
- data/features/text_area.feature +1 -3
- data/features/text_field.feature +0 -2
- data/lib/page-object/accessors.rb +53 -58
- data/lib/page-object/element_locators.rb +187 -104
- data/lib/page-object/elements/element.rb +7 -7
- data/lib/page-object/elements/hidden_field.rb +2 -10
- data/lib/page-object/elements/text_area.rb +0 -16
- data/lib/page-object/elements/text_field.rb +2 -10
- data/lib/page-object/platforms/selenium_webdriver/null_selenium_element.rb +28 -0
- data/lib/page-object/platforms/selenium_webdriver/page_object.rb +8 -0
- data/lib/page-object/platforms/watir_webdriver/page_object.rb +10 -1
- data/lib/page-object/version.rb +1 -1
- data/page-object.gemspec +1 -1
- data/spec/page-object/accessors_spec.rb +180 -0
- data/spec/page-object/element_locators_spec.rb +281 -2
- data/spec/page-object/elements/hidden_field_spec.rb +2 -12
- data/spec/page-object/elements/text_area_spec.rb +2 -12
- data/spec/page-object/elements/text_field_spec.rb +2 -12
- metadata +16 -15
@@ -6,28 +6,18 @@ describe PageObject::Elements::HiddenField do
|
|
6
6
|
|
7
7
|
describe "when mapping how to find an element" do
|
8
8
|
it "should map watir types to same" do
|
9
|
-
[:class, :id, :index, :name, :
|
9
|
+
[:class, :id, :index, :name, :text, :xpath, :value].each do |t|
|
10
10
|
identifier = hiddenfield.watir_identifier_for t => 'value'
|
11
11
|
identifier.keys.first.should == t
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
it "should map selenium types to watir" do
|
16
|
-
identifier = hiddenfield.watir_identifier_for :css => 'value'
|
17
|
-
identifier.keys.first.should == :tag_name
|
18
|
-
end
|
19
|
-
|
20
15
|
it "should map selenium types to same" do
|
21
|
-
[:class, :
|
16
|
+
[:class, :id, :name, :xpath, :index, :value].each do |t|
|
22
17
|
key, value = hiddenfield.selenium_identifier_for t => 'value'
|
23
18
|
key.should == t
|
24
19
|
end
|
25
20
|
end
|
26
|
-
|
27
|
-
it "should map watir types to selenium" do
|
28
|
-
key, value = hiddenfield.selenium_identifier_for :tag_name => 'value'
|
29
|
-
key.should == :css
|
30
|
-
end
|
31
21
|
end
|
32
22
|
|
33
23
|
describe "interface" do
|
@@ -6,28 +6,18 @@ describe PageObject::Elements::TextArea do
|
|
6
6
|
|
7
7
|
describe "when mapping how to find an element" do
|
8
8
|
it "should map watir types to same" do
|
9
|
-
[:class, :id, :index, :name, :
|
9
|
+
[:class, :id, :index, :name, :xpath].each do |t|
|
10
10
|
identifier = textarea.watir_identifier_for t => 'value'
|
11
11
|
identifier.keys.first.should == t
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
it "should map selenium types to watir" do
|
16
|
-
identifier = textarea.watir_identifier_for :css => 'value'
|
17
|
-
identifier.keys.first.should == :tag_name
|
18
|
-
end
|
19
|
-
|
20
15
|
it "should map selenium types to same" do
|
21
|
-
[:class, :
|
16
|
+
[:class, :id, :name, :xpath, :index].each do |t|
|
22
17
|
key, value = textarea.selenium_identifier_for t => 'value'
|
23
18
|
key.should == t
|
24
19
|
end
|
25
20
|
end
|
26
|
-
|
27
|
-
it "should map watir types to selenium" do
|
28
|
-
key, value = textarea.selenium_identifier_for :tag_name => 'value'
|
29
|
-
key.should == :css
|
30
|
-
end
|
31
21
|
end
|
32
22
|
|
33
23
|
describe "interface" do
|
@@ -7,28 +7,18 @@ describe PageObject::Elements::TextField do
|
|
7
7
|
let(:textfield) { PageObject::Elements::TextField }
|
8
8
|
|
9
9
|
it "should map watir types to same" do
|
10
|
-
[:class, :id, :index, :name, :
|
10
|
+
[:class, :id, :index, :name, :title, :xpath].each do |t|
|
11
11
|
identifier = textfield.watir_identifier_for t => 'value'
|
12
12
|
identifier.keys.first.should == t
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
it "should map selenium types to watir" do
|
17
|
-
identifier = textfield.watir_identifier_for :css => 'value'
|
18
|
-
identifier.keys.first.should == :tag_name
|
19
|
-
end
|
20
|
-
|
21
16
|
it "should map selenium types to same" do
|
22
|
-
[:class, :
|
17
|
+
[:class, :id, :name, :title, :xpath, :index].each do |t|
|
23
18
|
key, value = textfield.selenium_identifier_for t => 'value'
|
24
19
|
key.should == t
|
25
20
|
end
|
26
21
|
end
|
27
|
-
|
28
|
-
it "should map watir types to selenium" do
|
29
|
-
key, value = textfield.selenium_identifier_for :tag_name => 'value'
|
30
|
-
key.should == :css
|
31
|
-
end
|
32
22
|
end
|
33
23
|
|
34
24
|
describe "interface" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: page-object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-04-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: watir-webdriver
|
16
|
-
requirement: &
|
16
|
+
requirement: &70361806936260 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,21 +21,21 @@ dependencies:
|
|
21
21
|
version: 0.5.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70361806936260
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: selenium-webdriver
|
27
|
-
requirement: &
|
27
|
+
requirement: &70361806931840 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 2.
|
32
|
+
version: 2.21.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70361806931840
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70361806930760 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 2.6.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70361806930760
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: cucumber
|
49
|
-
requirement: &
|
49
|
+
requirement: &70361806907900 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.1.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70361806907900
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: yard
|
60
|
-
requirement: &
|
60
|
+
requirement: &70361798515720 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.7.2
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70361798515720
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rack
|
71
|
-
requirement: &
|
71
|
+
requirement: &70361798513340 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '1.0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70361798513340
|
80
80
|
description: Page Object DSL that works with both Watir and Selenium
|
81
81
|
email:
|
82
82
|
- jeff.morgan@leandog.com
|
@@ -232,6 +232,7 @@ files:
|
|
232
232
|
- lib/page-object/platforms/selenium_webdriver/form.rb
|
233
233
|
- lib/page-object/platforms/selenium_webdriver/image.rb
|
234
234
|
- lib/page-object/platforms/selenium_webdriver/link.rb
|
235
|
+
- lib/page-object/platforms/selenium_webdriver/null_selenium_element.rb
|
235
236
|
- lib/page-object/platforms/selenium_webdriver/ordered_list.rb
|
236
237
|
- lib/page-object/platforms/selenium_webdriver/page_object.rb
|
237
238
|
- lib/page-object/platforms/selenium_webdriver/radio_button.rb
|