selenium_fury 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4384dc1031f56f82ead4481245cc8795c6dc4ae
4
- data.tar.gz: 65d2ee19486cb2bc650b3fc3762095c0c404c32d
3
+ metadata.gz: dffe5d7e41e74e4bf99f6d200b3ce6cafb5ae9ea
4
+ data.tar.gz: d595ed3b8400085c8dc9296be01dfc6a1bdffe88
5
5
  SHA512:
6
- metadata.gz: 9eda54ceca7714cd531f748820e773e611411846aa2679b0205b5cf4eab026b0b379aa0c4b4444f91b7c1819c57034d8840a5fcf724b74dee78c70327c0ed32f
7
- data.tar.gz: 8893451bfc13ada7f125ab8d9c513dfa6dbfa6cc5506940f804e373588351c8a1a58f5e107b0d9f400e1e4ca9d0b45d7e91d8bde5836e855e8b32d3a05baded9
6
+ metadata.gz: 6015d528bfda77059819a8125b22493d89d43e39da64b8bc0a1f232251736f66cb2fda6cce7201adfc51566c56ac81491810d6b8c96f50215e57c4de3d373cf8
7
+ data.tar.gz: fa032c1e9caae9826efd90738023ecd68ea7d98eb46a311f06805f0b8640dacfeeaae0da6d43cadc44be0925bec85f9291ad517b1a7e3a77157af90be0cf152b
@@ -99,10 +99,24 @@ module CheckboxElementHelpers
99
99
  end
100
100
 
101
101
  module DropDownHelpers
102
+
102
103
  def selected_option
104
+ Selenium::WebDriver::Support::Select.new(el).first_selected_option
105
+ end
106
+
107
+ def selected_option_text
103
108
  Selenium::WebDriver::Support::Select.new(el).first_selected_option.text
104
109
  end
105
110
 
111
+ def selected_option_value
112
+ Selenium::WebDriver::Support::Select.new(el).first_selected_option['value']
113
+ end
114
+
115
+ def selected_option_index
116
+ index = Selenium::WebDriver::Support::Select.new(el).first_selected_option['index']
117
+ index.nil? ? index : index.to_i
118
+ end
119
+
106
120
  # how can be :text, :index, :value
107
121
  def select_option(how=nil, what=nil)
108
122
  raise "Locator at #{location} can not be interacted with" unless visible?
@@ -1,3 +1,3 @@
1
1
  module SeleniumFury
2
- VERSION = "1.0.8"
2
+ VERSION = "1.0.9"
3
3
  end
@@ -131,19 +131,41 @@ describe PageObject do
131
131
 
132
132
  it 'should select from a dropdown by value' do
133
133
  test_page.select_element.select_option(:value, 'mercedes')
134
- test_page.select_element.selected_option.should == 'Mercedes'
134
+ test_page.select_element.selected_option_text.should == 'Mercedes'
135
135
  end
136
136
 
137
137
  it 'should select from a dropdown by text' do
138
138
  what = 'Mercedes'
139
139
  test_page.select_element.select_option(:text, what)
140
- test_page.select_element.selected_option.should == what
140
+ test_page.select_element.selected_option_text.should == what
141
141
  end
142
142
 
143
143
  it 'should select from a dropdown by index' do
144
144
  test_page.select_element.select_option(:index, 3)
145
- test_page.select_element.selected_option.should == 'Audi'
145
+ test_page.select_element.selected_option_text.should == 'Audi'
146
146
  end
147
+
148
+ it 'should be able to grab a dropdowns selected option' do
149
+ test_page.select_element.select_option(:value, 'mercedes')
150
+ test_page.select_element.selected_option.should_not be_nil
151
+ test_page.select_element.selected_option.should be_a Selenium::WebDriver::Element
152
+ end
153
+
154
+ it 'should be able grab a dropdowns selected options text' do
155
+ test_page.select_element.select_option(:value, 'mercedes')
156
+ test_page.select_element.selected_option_text.should == 'Mercedes'
157
+ end
158
+
159
+ it 'should be able to grab a dropdowns selected options value' do
160
+ test_page.select_element.select_option(:text, 'Saab')
161
+ test_page.select_element.selected_option_value.should == 'saab'
162
+ end
163
+
164
+ it 'should be able to grab a dropdowns selected options index' do
165
+ test_page.select_element.select_option(:text, 'Saab')
166
+ test_page.select_element.selected_option_index.should == 1
167
+ end
168
+
147
169
  end
148
170
 
149
171
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium_fury
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Sims
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-09 00:00:00.000000000 Z
11
+ date: 2014-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver