testcentricity_web 3.1.6 → 3.1.7

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: 3576023f31b7c27ea1abd6e8e24613d441c79ce1
4
- data.tar.gz: 78635445bac00d83066db607da4097175a538a2b
3
+ metadata.gz: d020866a145ba6ad53811773f2949f0caabd8eae
4
+ data.tar.gz: cb94a1765b8cda6b95f741b06ea365b9c9e0296b
5
5
  SHA512:
6
- metadata.gz: 42b4e0b47ee73eb1629d394cef4c4ced3d94d042058a96c1e8d9cf63f332fb28456c7757269468af5be3d5b7208ef9a4db167478b9d82b2df397499bed286814
7
- data.tar.gz: 5f9738b0e5d5abea78777da9aceffcd33d50e7bcfec9d229d6e7aa2b055c2872fc6b3abe6b798f30b514fe68c93ccb282fa1ae6cd4dabfb22a930c36237a987d
6
+ metadata.gz: 25e5dac7edc1af4d721b6f60ac5d4da9622aa8c2c275f4840bb0bebf2686dd57ef50c04ce1d360da3e7eab33ac9547984b94b9d549f20a67a26dd72ee526c678
7
+ data.tar.gz: 17eedf849e3e0eff61d1d482bd84441b22e8ed4142a56838e1b6064007c7f5976e6244924e5bd9c69c488d3c26acb2aab3f648f43b0e2d0293af27435a342461
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
4
 
5
+ ## [3.1.7] - 2019-02-01
6
+
7
+ ### Added
8
+ * Added `UIElement.title` and `PageObject.title` methods.
9
+ * Added `Video.video_height`, and `Video.video_width` methods.
10
+ * Updated `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods to support verification of `title` property.
11
+
12
+
5
13
  ## [3.1.6] - 2019-01-20
6
14
 
7
15
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- testcentricity_web (3.1.6)
4
+ testcentricity_web (3.1.7)
5
5
  appium_lib
6
6
  browserstack-local
7
7
  capybara (>= 3.1, < 4)
@@ -25,7 +25,7 @@ GEM
25
25
  appium_lib_core (~> 2.3)
26
26
  nokogiri (~> 1.8, >= 1.8.1)
27
27
  tomlrb (~> 1.1)
28
- appium_lib_core (2.3.2)
28
+ appium_lib_core (2.3.4)
29
29
  faye-websocket (~> 0.10.0)
30
30
  selenium-webdriver (~> 3.14, >= 3.14.1)
31
31
  axiom-types (0.1.1)
@@ -33,7 +33,7 @@ GEM
33
33
  ice_nine (~> 0.11.0)
34
34
  thread_safe (~> 0.3, >= 0.3.1)
35
35
  browserstack-local (1.3.0)
36
- capybara (3.12.0)
36
+ capybara (3.13.2)
37
37
  addressable
38
38
  mini_mime (>= 0.1.3)
39
39
  nokogiri (~> 1.8)
@@ -57,7 +57,7 @@ GEM
57
57
  eventmachine (>= 0.12.0)
58
58
  websocket-driver (>= 0.5.1)
59
59
  ffi (1.10.0)
60
- i18n (1.5.2)
60
+ i18n (1.5.3)
61
61
  concurrent-ruby (~> 1.0)
62
62
  ice_nine (0.11.2)
63
63
  mini_mime (1.0.1)
@@ -81,7 +81,7 @@ GEM
81
81
  rubyzip (~> 1.2, >= 1.2.2)
82
82
  spreadsheet (1.1.7)
83
83
  ruby-ole (>= 1.0)
84
- test-unit (3.2.9)
84
+ test-unit (3.3.0)
85
85
  power_assert
86
86
  thread_safe (0.3.6)
87
87
  tomlrb (1.2.8)
data/README.md CHANGED
@@ -488,6 +488,7 @@ With TestCentricity, all UI elements are based on the **UIElement** class, and i
488
488
  element.get_value
489
489
  element.count
490
490
  element.style
491
+ element.title
491
492
  element.width
492
493
  element.height
493
494
  element.x
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '3.1.6'
2
+ VERSION = '3.1.7'
3
3
  end
@@ -399,9 +399,7 @@ module TestCentricity
399
399
 
400
400
  def open_portal
401
401
  environment = Environ.current
402
- environment.hostname.blank? ?
403
- url = "#{environment.base_url}#{environment.append}" :
404
- url = "#{environment.hostname}/#{environment.base_url}#{environment.append}"
402
+ url = environment.hostname.blank? ? "#{environment.base_url}#{environment.append}" : "#{environment.hostname}/#{environment.base_url}#{environment.append}"
405
403
  if environment.user_id.blank? || environment.password.blank?
406
404
  visit "#{environment.protocol}://#{url}"
407
405
  else
@@ -469,6 +467,16 @@ module TestCentricity
469
467
  Capybara.default_max_wait_time = saved_wait_time
470
468
  end
471
469
 
470
+ # Return page title
471
+ #
472
+ # @return [String]
473
+ # @example
474
+ # home_page.title
475
+ #
476
+ def title
477
+ page.driver.browser.title
478
+ end
479
+
472
480
  # Wait until the page object exists, or until the specified wait time has expired. If the wait time is nil, then the wait
473
481
  # time will be Capybara.default_max_wait_time.
474
482
  #
@@ -519,7 +527,7 @@ module TestCentricity
519
527
  Timeout.timeout(wait_time) do
520
528
  loop do
521
529
  active = page.evaluate_script('jQuery.active')
522
- break if active == 0
530
+ break if active.zero?
523
531
  end
524
532
  end
525
533
  end
@@ -542,6 +550,8 @@ module TestCentricity
542
550
  actual = ui_object.get_attribute(:class)
543
551
  when :name
544
552
  actual = ui_object.get_attribute(:name)
553
+ when :title
554
+ actual = ui_object.title
545
555
  when :exists
546
556
  actual = ui_object.exists?
547
557
  when :enabled
@@ -696,7 +706,11 @@ module TestCentricity
696
706
  end
697
707
  end
698
708
  end
699
- error_msg = "Expected UI object '#{ui_object.get_name}' (#{ui_object.get_locator}) #{property} property to"
709
+ error_msg = if ui_object.respond_to?(:get_name)
710
+ "Expected UI object '#{ui_object.get_name}' (#{ui_object.get_locator}) #{property} property to"
711
+ else
712
+ "Expected '#{page_name}' page object #{property} property to"
713
+ end
700
714
  ExceptionQueue.enqueue_comparison(ui_object, state, actual, error_msg)
701
715
  end
702
716
  end
@@ -742,6 +742,8 @@ module TestCentricity
742
742
  actual = ui_object.get_attribute(:class)
743
743
  when :name
744
744
  actual = ui_object.get_attribute(:name)
745
+ when :title
746
+ actual = ui_object.title
745
747
  when :exists
746
748
  actual = ui_object.exists?
747
749
  when :enabled
@@ -433,6 +433,16 @@ module TestCentricity
433
433
  obj.get_y
434
434
  end
435
435
 
436
+ # Return UI object's title property
437
+ #
438
+ # @return [String]
439
+ # @example
440
+ # buy_now_button.title
441
+ #
442
+ def title
443
+ get_attribute(:title)
444
+ end
445
+
436
446
  # Is UI object displayed in browser window?
437
447
  #
438
448
  # @return [Boolean]
@@ -193,6 +193,30 @@ module TestCentricity
193
193
  obj.native.attribute('volume')
194
194
  end
195
195
 
196
+ # Return video Height property
197
+ #
198
+ # @return [Integer] video height
199
+ # @example
200
+ # height = video_player.video_height
201
+ #
202
+ def video_height
203
+ obj, = find_element
204
+ object_not_found_exception(obj, nil)
205
+ obj.native.attribute('videoHeight')
206
+ end
207
+
208
+ # Return video Width property
209
+ #
210
+ # @return [Integer] video width
211
+ # @example
212
+ # width = video_player.video_width
213
+ #
214
+ def video_width
215
+ obj, = find_element
216
+ object_not_found_exception(obj, nil)
217
+ obj.native.attribute('videoWidth')
218
+ end
219
+
196
220
  # Set the video currentTime property
197
221
  #
198
222
  # @param value [Float] time in seconds
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: 3.1.6
4
+ version: 3.1.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: 2019-01-20 00:00:00.000000000 Z
11
+ date: 2019-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler