testcentricity_web 0.8.6 → 0.8.7

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: 46f221d429005695cfe725405ceeac27dc014a51
4
- data.tar.gz: b4e453405af158d083fb30db316e831157c17299
3
+ metadata.gz: 3fa1311e296cf791b910409f84158f864898f0ef
4
+ data.tar.gz: 60c52b240c5d0391e674476ea82aa25ed589f355
5
5
  SHA512:
6
- metadata.gz: ea53e730b528a93a2b696a7d17f8d502029c1da8ae54dc824da94fe26ae1e829956c4c06c129bb212d734690f0c6d6e0d631a9ec6b4325cebe33f8d3af17de3e
7
- data.tar.gz: f81888c37a47552b865d0f3cda27cef9368fdf4f217531c9a8e60af68709aa1a2f51b398b25ccc93f6d81f0e1018e72fd71c01b60cfb8b905191df9549a893b6
6
+ metadata.gz: b2912afd0fcae3d084304fd388516d8f49c2e5b9ad9d0054e69b052843b96ef3bd2e77e18c7ece153bd242c753ada9e8680a6d3155ae4f084c2496c0e095e569
7
+ data.tar.gz: 15961c490a34bcce68efd0b958b2336168d111d801513b3e2976715ab33ca97461c327c86bf8ff1286eaf45f039fdc8ebeb4ff0390046166560a9b9a3811595c
@@ -36,14 +36,10 @@ module TestCentricity
36
36
  else
37
37
  if option.is_a?(Array)
38
38
  option.each do |item|
39
- obj.select item
39
+ select_item(obj, item)
40
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)
45
41
  else
46
- obj.select option
42
+ select_item(obj, option)
47
43
  end
48
44
  end
49
45
  end
@@ -126,5 +122,17 @@ module TestCentricity
126
122
  obj, _ = find_element
127
123
  obj.native.send_keys(:escape)
128
124
  end
125
+
126
+ private
127
+
128
+ def select_item(obj, option)
129
+ if option.is_a?(Hash)
130
+ obj.find("option[value='#{option[:value]}']").click if option.has_key?(:value)
131
+ obj.find(:xpath, "option[#{option[:index]}]").select_option if option.has_key?(:index)
132
+ obj.select option[:text] if option.has_key?(:text)
133
+ else
134
+ obj.select option
135
+ end
136
+ end
129
137
  end
130
138
  end
@@ -32,4 +32,16 @@ module TestCentricity
32
32
  object_not_found_exception(obj, nil)
33
33
  obj.native.attribute('maxlength')
34
34
  end
35
+
36
+ # Return placeholder text of a text field.
37
+ #
38
+ # @return [String]
39
+ # @example
40
+ # placeholder_message = username_field.get_placeholder
41
+ #
42
+ def get_placeholder
43
+ obj, _ = find_element
44
+ object_not_found_exception(obj, nil)
45
+ obj.native.attribute('placeholder')
46
+ end
35
47
  end
@@ -260,6 +260,8 @@ module TestCentricity
260
260
  actual = ui_object.get_value
261
261
  when :maxlength
262
262
  actual = ui_object.get_max_length
263
+ when :placeholder
264
+ actual = ui_object.get_placeholder
263
265
  when :options
264
266
  actual = ui_object.get_options
265
267
  when :column_headers
@@ -276,6 +276,8 @@ module TestCentricity
276
276
  actual = ui_object.get_value
277
277
  when :maxlength
278
278
  actual = ui_object.get_max_length
279
+ when :placeholder
280
+ actual = ui_object.get_placeholder
279
281
  when :options
280
282
  actual = ui_object.get_options
281
283
  when :column_headers
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '0.8.6'
2
+ VERSION = '0.8.7'
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.6
4
+ version: 0.8.7
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-30 00:00:00.000000000 Z
11
+ date: 2016-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler