testcentricity_web 0.9.5 → 0.9.5.1
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 +4 -4
- data/lib/testcentricity_web/elements/select_list.rb +20 -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: 88aac8ff177862c420a604d05088035cfe759e54
|
4
|
+
data.tar.gz: 83d0ad7b44a60bb8b3230d463309252a46d207c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6561b0d268afc55d7dfd5bd5f81b5a6fddee63f7ffd0e5a4e634e49ecec44d4a88bc257f588ea33fc4e5dbc7ffb8e036dd5958f93a7cae749cfe67eedf72539
|
7
|
+
data.tar.gz: 8e9225df1d4654498baabbd02c191d0ebca13051029a0eeb8aa1798d8d3c5e4dc8bcba81f51f50d455a368152eee3f9363a53a5a38de22935ccb56c6c5a0bc49
|
@@ -1,11 +1,29 @@
|
|
1
1
|
module TestCentricity
|
2
2
|
class SelectList < UIElement
|
3
|
+
attr_accessor :list_item
|
4
|
+
attr_accessor :selected_item
|
5
|
+
|
3
6
|
def initialize(parent, locator, context)
|
4
7
|
@parent = parent
|
5
8
|
@locator = locator
|
6
9
|
@context = context
|
7
10
|
@type = :selectlist
|
8
11
|
@alt_locator = nil
|
12
|
+
list_spec = { :list_item => 'option',
|
13
|
+
:selected_item => 'option[selected]'
|
14
|
+
}
|
15
|
+
define_list_elements(list_spec)
|
16
|
+
end
|
17
|
+
|
18
|
+
def define_list_elements(element_spec)
|
19
|
+
element_spec.each do | element, value |
|
20
|
+
case element
|
21
|
+
when :list_item
|
22
|
+
@list_item = value
|
23
|
+
when :selected_item
|
24
|
+
@selected_item = value
|
25
|
+
end
|
26
|
+
end
|
9
27
|
end
|
10
28
|
|
11
29
|
# Select the specified option in a select box object. Accepts a String or Hash.
|
@@ -57,7 +75,7 @@ module TestCentricity
|
|
57
75
|
if first(:css, 'li.active-result')
|
58
76
|
obj.all('li.active-result').collect(&:text)
|
59
77
|
else
|
60
|
-
obj.all(
|
78
|
+
obj.all(@list_item).collect(&:text)
|
61
79
|
end
|
62
80
|
end
|
63
81
|
|
@@ -81,7 +99,7 @@ module TestCentricity
|
|
81
99
|
if first(:css, 'li.active-result')
|
82
100
|
obj.first("//li[contains(@class, 'result-selected')]").text
|
83
101
|
else
|
84
|
-
obj.first(
|
102
|
+
obj.first(@selected_item).text
|
85
103
|
end
|
86
104
|
end
|
87
105
|
|
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.9.5
|
4
|
+
version: 0.9.5.1
|
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-06-
|
11
|
+
date: 2016-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|