testcentricity_web 0.8.5 → 0.8.6

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: 9bbfb936f79837f0b55e509d6e429961a60273fc
4
- data.tar.gz: 4efaff622674029281129244716f096954c70dd0
3
+ metadata.gz: 46f221d429005695cfe725405ceeac27dc014a51
4
+ data.tar.gz: b4e453405af158d083fb30db316e831157c17299
5
5
  SHA512:
6
- metadata.gz: 2399efaf67076b342b77e7e247c4718f5a659c52f81ef87e4f4ad52a40003fbcecb6105b08133b775f56874b1f71955aa4e6fd8d38923a7dab0eb58a13016043
7
- data.tar.gz: 7879302d7cdacbc278ee8ef624a03ae90724a87621a18dfb3d7b79c79cd5bd65b419976328db3b3960de833fa29df72f02a4ae537a6631b31d3c1a87b70f04eb
6
+ metadata.gz: ea53e730b528a93a2b696a7d17f8d502029c1da8ae54dc824da94fe26ae1e829956c4c06c129bb212d734690f0c6d6e0d631a9ec6b4325cebe33f8d3af17de3e
7
+ data.tar.gz: f81888c37a47552b865d0f3cda27cef9368fdf4f217531c9a8e60af68709aa1a2f51b398b25ccc93f6d81f0e1018e72fd71c01b60cfb8b905191df9549a893b6
@@ -8,12 +8,18 @@ module TestCentricity
8
8
  @alt_locator = nil
9
9
  end
10
10
 
11
- # Select the specified option in a select box object.
11
+ # Select the specified option in a select box object. Accepts a String or Hash.
12
12
  # Supports standard HTML select objects and Chosen select objects.
13
13
  #
14
14
  # @param option [String] text of option to select
15
+ # OR
16
+ # @param option [Hash] :value, :index, or :text of option to select
17
+ #
15
18
  # @example
16
- # province_select.choose_option('Nova Scotia')
19
+ # province_select.choose_option('Alberta')
20
+ # province_select.choose_option(:value => 'AB')
21
+ # state_select.choose_option(:index => 24)
22
+ # state_select.choose_option(:text => 'Maryland')
17
23
  #
18
24
  def choose_option(option)
19
25
  obj, _ = find_element
@@ -32,6 +38,10 @@ module TestCentricity
32
38
  option.each do |item|
33
39
  obj.select item
34
40
  end
41
+ elsif option.is_a?(Hash)
42
+ obj.find("option[value='#{option[:value]}']").click if option.has_key?(:value)
43
+ obj.find(:xpath, "option[#{option[:index]}]").select_option if option.has_key?(:index)
44
+ obj.select option[:text] if option.has_key?(:text)
35
45
  else
36
46
  obj.select option
37
47
  end
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '0.8.5'
2
+ VERSION = '0.8.6'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: testcentricity_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - A.J. Mrozinski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-28 00:00:00.000000000 Z
11
+ date: 2016-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler