page-object 0.9.7 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1156a7970aead05123219c89c803265b667a78dd
4
- data.tar.gz: b3c0e0f5b3aca905ecf086e075ed69d3fef38407
3
+ metadata.gz: a30377dc0af7ba09c90456f8e21a54a59f55f43f
4
+ data.tar.gz: 23f24c2b8aecef31248f0316f68d6fe523bd2598
5
5
  SHA512:
6
- metadata.gz: 03fb39890fda2a007e2f4938f54f62354c9af1bc5935dd7678a1fe33122c826b1cedc13c38391121904d9d0f2466a7bd41a233051a1a2024ea29f074260c0d25
7
- data.tar.gz: 4c6a7007c11534fa43c3e57218accdbe23000db35da0d772017965c54d82fa4dc2b234bb075d260d97cf0a4bcf1d537c8687635cf4a569cfcd356f846b3f0c81
6
+ metadata.gz: 4b9fe63e3d0c4d464b92aed01b9cf33caf9db545c0df3ee5e989a85579bc4093ebc7336ad2a25d5af699fdac667cc7580442e7ea2f3bb4f81aa8e69ed97463c1
7
+ data.tar.gz: 70c3f5da44e5b37fcfca5cac3388793ce1a156dceb5cc02706a6abf1406601b95c4a33f79359f15cedafb3d83f68bf457c2564e032a4dc1df4638ce674bcfdb5
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.0.0-p353
1
+ ruby-2.1.1
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ === Version 0.9.8 / 2014-3-16
2
+ * Enhancements
3
+ * populate_page_with not supports radio groups
4
+
1
5
  === Version 0.9.7 / 2014-2-26
2
6
  * Enhancements
3
7
  * Table now supports exists?
@@ -16,12 +16,12 @@ Feature: Radio Button Groups
16
16
  Scenario: Selecting grouped radio buttons by value
17
17
  When I select the "ched" radio button in the group
18
18
  Then the "ched" radio button should be selected in the group
19
- Then the "emmen" radio button should not be selected
20
- Then the "muen" radio button should not be selected
19
+ And the "emmen" radio button should not be selected
20
+ And the "muen" radio button should not be selected
21
21
  When I select the "muen" radio button in the group
22
22
  Then the "ched" radio button should not be selected
23
- Then the "emmen" radio button should not be selected
24
- Then the "muen" radio button should be selected in the group
23
+ And the "emmen" radio button should not be selected
24
+ And the "muen" radio button should be selected in the group
25
25
 
26
26
  Scenario: Getting an array of elements for each radio button in the group
27
27
  When I ask for the elements of a radio button group
@@ -32,6 +32,7 @@ module PageObject
32
32
  def populate_page_with(data)
33
33
  data.each do |key, value|
34
34
  populate_checkbox(key, value) if is_checkbox?(key) and is_enabled?(key)
35
+ populate_radiobuttongroup(key, value) if is_radiobuttongroup?(key)
35
36
  populate_radiobutton(key, value) if is_radiobutton?(key) and is_enabled?(key)
36
37
  populate_text(key, value) if is_text?(key) and is_enabled?(key)
37
38
  end
@@ -53,6 +54,10 @@ module PageObject
53
54
  return self.send "clear_#{key}"
54
55
  end
55
56
 
57
+ def populate_radiobuttongroup(key, value)
58
+ return self.send("select_#{key}", value)
59
+ end
60
+
56
61
  def is_text?(key)
57
62
  respond_to?("#{key}=".to_sym)
58
63
  end
@@ -65,7 +70,12 @@ module PageObject
65
70
  respond_to?("select_#{key}".to_sym)
66
71
  end
67
72
 
73
+ def is_radiobuttongroup?(key)
74
+ respond_to?("select_#{key}".to_sym) and respond_to?("#{key}_values")
75
+ end
76
+
68
77
  def is_enabled?(key)
78
+ return false if is_radiobuttongroup?(key)
69
79
  return true if (self.send "#{key}_element").tag_name == "textarea"
70
80
  element = self.send("#{key}_element")
71
81
  element.enabled? and element.visible?
@@ -1,4 +1,4 @@
1
1
  module PageObject
2
2
  # @private
3
- VERSION = "0.9.7"
3
+ VERSION = "0.9.8"
4
4
  end
@@ -126,7 +126,7 @@ describe PageObject::Elements::SelectList do
126
126
  sel_list.should_receive(:find_elements).and_return(opts)
127
127
  opts[0].should_receive(:selected?).twice.and_return(true)
128
128
  opts[0].should_receive(:text).and_return('blah')
129
- selenium_sel_list.selected?('blah').should be_true
129
+ selenium_sel_list.selected?('blah').should be true
130
130
  end
131
131
 
132
132
  it "should be able to clear selected options" do
@@ -58,7 +58,7 @@ describe "Element for Selenium" do
58
58
 
59
59
  it "should know how to retrieve the value of an attribute" do
60
60
  @selenium_driver.should_receive(:attribute).and_return(true)
61
- @selenium_element.attribute('readonly').should be_true
61
+ @selenium_element.attribute('readonly').should be true
62
62
  end
63
63
 
64
64
  it "should be clickable" do
@@ -15,7 +15,7 @@ describe PageObject::Elements::TableCell do
15
15
  it "should always be enabled" do
16
16
  table_cell_element = double('table_cell_element')
17
17
  table_cell = PageObject::Elements::TableCell.new(table_cell_element, :platform => :selenium_webdriver)
18
- table_cell.enabled?.should be_true
18
+ table_cell.enabled?.should be true
19
19
  end
20
20
  end
21
21
  end
@@ -56,7 +56,7 @@ describe "Element for Watir" do
56
56
  it "should know how to retrieve the value of an attribute" do
57
57
  watir_driver.stub(:attribute_value).and_return(true)
58
58
  watir_driver.stub(:attribute).and_return(true)
59
- watir_element.attribute("readonly").should be_true
59
+ watir_element.attribute("readonly").should be true
60
60
  end
61
61
 
62
62
  it "should be clickable" do
@@ -123,7 +123,7 @@ describe PageObject do
123
123
  end
124
124
 
125
125
  @page = CallbackPage.new(watir_browser)
126
- @page.initialize_page_called.should be_true
126
+ @page.initialize_page_called.should be true
127
127
  end
128
128
 
129
129
  it "should call initialize_accessors if it exists" do
@@ -137,7 +137,7 @@ describe PageObject do
137
137
  end
138
138
 
139
139
  @page = CallbackPage.new(watir_browser)
140
- @page.initialize_accessors_called.should be_true
140
+ @page.initialize_accessors_called.should be true
141
141
  end
142
142
 
143
143
  it "should call initialize_accessors before initialize_page if both exist" do
@@ -50,7 +50,7 @@ describe PageObject::PageFactory do
50
50
  class NoPO
51
51
  end
52
52
  @world.on(NoPO)
53
- @world.super_called.should be_true
53
+ @world.super_called.should be true
54
54
  end
55
55
 
56
56
  it "should create a new page object and execute a block" do
@@ -9,6 +9,7 @@ class PageObjectTestPageObject
9
9
  file_field(:ff, :id => 'id')
10
10
  checkbox(:cb, :id => 'id')
11
11
  radio_button(:rb, :id => 'id')
12
+ radio_button_group(:rbg, :id => 'id')
12
13
  end
13
14
 
14
15
  describe PageObject::PagePopulator do
@@ -86,6 +87,11 @@ describe PageObject::PagePopulator do
86
87
  page_object.populate_page_with('rb' => false)
87
88
  end
88
89
 
90
+ it "should select the correct element from a radio button group" do
91
+ page_object.should_receive(:select_rbg).with('blah')
92
+ page_object.populate_page_with('rbg' => 'blah')
93
+ end
94
+
89
95
  it "should not populate a checkbox if it is disabled" do
90
96
  page_object.should_not_receive(:check_cb)
91
97
  page_object.should_receive(:cb_element).twice.and_return(browser)
@@ -49,7 +49,7 @@ describe PageObject::Platforms::SeleniumWebDriver::PageObject do
49
49
  it "should know it is not exist" do
50
50
  selenium_browser.should_receive(:find_element).twice.and_raise(Selenium::WebDriver::Error::NoSuchElementError)
51
51
  page = SeleniumTestPageObject.new(selenium_browser)
52
- page.link_element(:text => 'blah').element.exists?.should be_false
52
+ page.link_element(:text => 'blah').element.exists?.should be false
53
53
  end
54
54
 
55
55
  it "should know it is not visible" do
@@ -271,7 +271,7 @@ describe PageObject::Accessors do
271
271
  it "should know if a check box element is selected" do
272
272
  selenium_browser.should_receive(:find_element).and_return(selenium_browser)
273
273
  selenium_browser.should_receive(:selected?).and_return(true)
274
- selenium_page_object.active_checked?.should be_true
274
+ selenium_page_object.active_checked?.should be true
275
275
  end
276
276
 
277
277
  it "should retrieve a checkbox element" do
@@ -580,7 +580,7 @@ describe PageObject::Accessors do
580
580
  it "should know if a check box element is selected" do
581
581
  watir_browser.should_receive(:checkbox).and_return(watir_browser)
582
582
  watir_browser.should_receive(:set?).and_return(true)
583
- watir_page_object.active_checked?.should be_true
583
+ watir_page_object.active_checked?.should be true
584
584
  end
585
585
 
586
586
  it "should retrieve a checkbox element" do
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: page-object
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.7
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Morgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-26 00:00:00.000000000 Z
11
+ date: 2014-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: watir-webdriver
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.6.8
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.6.8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: selenium-webdriver
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 2.40.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.40.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: page_navigation
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.9'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.9'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: 2.14.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.14.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: cucumber
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: 1.3.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 1.3.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: yard
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: 0.7.2
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.7.2
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rack
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '1.0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.0'
111
111
  description: Page Object DSL that works with both Watir and Selenium
@@ -115,11 +115,11 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - .gitignore
119
- - .rspec
120
- - .ruby-gemset
121
- - .ruby-version
122
- - .travis.yml
118
+ - ".gitignore"
119
+ - ".rspec"
120
+ - ".ruby-gemset"
121
+ - ".ruby-version"
122
+ - ".travis.yml"
123
123
  - ChangeLog
124
124
  - Gemfile
125
125
  - Guardfile
@@ -383,17 +383,17 @@ require_paths:
383
383
  - lib
384
384
  required_ruby_version: !ruby/object:Gem::Requirement
385
385
  requirements:
386
- - - '>='
386
+ - - ">="
387
387
  - !ruby/object:Gem::Version
388
388
  version: '0'
389
389
  required_rubygems_version: !ruby/object:Gem::Requirement
390
390
  requirements:
391
- - - '>='
391
+ - - ">="
392
392
  - !ruby/object:Gem::Version
393
393
  version: '0'
394
394
  requirements: []
395
395
  rubyforge_project: page-object
396
- rubygems_version: 2.0.14
396
+ rubygems_version: 2.2.2
397
397
  signing_key:
398
398
  specification_version: 4
399
399
  summary: Page Object DSL for browser testing