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 +4 -4
- data/lib/testcentricity_web/elements/select_list.rb +12 -2
- data/lib/testcentricity_web/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46f221d429005695cfe725405ceeac27dc014a51
|
4
|
+
data.tar.gz: b4e453405af158d083fb30db316e831157c17299
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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('
|
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
|
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.
|
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-
|
11
|
+
date: 2016-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|