testcentricity_web 3.0.7 → 3.0.8

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: 9740d09f5ae251d5d16505b76876418ac8d64dfd
4
- data.tar.gz: bfbb4d31516bb66df59855505678317b88938ce8
3
+ metadata.gz: '09f6bbb5fd6d45a4e0783ce4a2eedcb8d81f58a5'
4
+ data.tar.gz: 144f6b80f4d26187a4d6890561b6da2af28435b3
5
5
  SHA512:
6
- metadata.gz: ee417aeb72511576084eb0cd2820c38c1ebc86cfaeeee3c9d275300ec789f885ea8bec537d61f19b666c61e2e48cb6ad41a78df9cd69d7bee1c4706ca4c08b9c
7
- data.tar.gz: d6711b2fd8ff0e84963596650a292380b807d0dfd34344cb6e09e5fabbcba9731a9f7a881c24e23811cdb1ebb95cdc8679f71b31d5710836e9c01c196f00423f
6
+ metadata.gz: bc1cd2e1cafa3546b9d155ede4f3d5143464eb61d6708981c725484d2935252347a3ed59d45c0670691ecfdfda7cae01e454957af88a63cb7c2b5fe4c95751d7
7
+ data.tar.gz: 47b00fcb5176454ddf83b4e1276802eae6fae3ec773ce1a074198e68369a959bc1b5893a7f52f813ad2288413fcc76ec08f6c73f99c4d274fc10a63a6e128fca
data/.rubocop.yml CHANGED
@@ -19,9 +19,6 @@ Metrics/ModuleLength:
19
19
  Metrics/ClassLength:
20
20
  Enabled: false
21
21
 
22
- Encoding:
23
- EnforcedStyle: when_needed
24
-
25
22
  Metrics/LineLength:
26
23
  Enabled: false
27
24
 
@@ -37,5 +34,5 @@ Style/HashSyntax:
37
34
  Metrics/CyclomaticComplexity:
38
35
  Enabled: false
39
36
 
40
- Style/EmptyLines:
37
+ Layout/EmptyLines:
41
38
  Enabled: false
data/HISTORY.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # HISTORY
2
2
 
3
+ ###Version 3.0.8
4
+
5
+ * Added `PageObject.wait_for_ajax` method.
6
+ * `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods now accept optional `fail_message` string parameter to add context to error
7
+ messages when UI verifications raise an exception.
8
+
3
9
  ###Version 3.0.7
4
10
 
5
11
  * Added support for connecting to and running your tests in desktop and emulated mobile web browsers hosted on Selenium Grid and Dockerized Selenium
data/README.md CHANGED
@@ -26,6 +26,12 @@ The TestCentricity™ Web gem supports running automated tests against the follo
26
26
 
27
27
  A complete history of bug fixes and new features can be found in the {file:HISTORY.md HISTORY} file.
28
28
 
29
+ ###Version 3.0.8
30
+
31
+ * Added `PageObject.wait_for_ajax` method.
32
+ * `PageObject.verify_ui_states` and `PageSection.verify_ui_states` methods now accept optional `fail_message` string parameter to add context to error
33
+ messages when UI verifications raise an exception.
34
+
29
35
  ###Version 3.0.7
30
36
 
31
37
  * Added support for connecting to and running your tests in desktop and emulated mobile web browsers hosted on Selenium Grid and Dockerized Selenium
@@ -1484,6 +1490,7 @@ text with the Subdomain specified on the Grid Configuration Parameters section o
1484
1490
  gl_ie10_win8: --profile gl_win8 GL_BROWSER="internet explorer" GL_VERSION="10"
1485
1491
  gl_ie11_win10: --profile gl_win10 GL_BROWSER="internet explorer" GL_VERSION="11"
1486
1492
 
1493
+ # Gridlastic Linux desktop browser profiles
1487
1494
  gl_chrome_linux: --profile gl_desktop GL_OS="LINUX" GL_BROWSER="chrome" GL_VERSION="latest"
1488
1495
 
1489
1496
 
@@ -22,8 +22,11 @@ module TestCentricity
22
22
  enqueue(error_message)
23
23
  end
24
24
 
25
- def self.post_exceptions
26
- raise @error_queue unless @error_queue.nil?
25
+ def self.post_exceptions(preample_message = nil)
26
+ unless @error_queue.nil?
27
+ @error_queue = "#{preample_message} - The following errors were found:\n_______________________________\n#{@error_queue}" unless preample_message.nil?
28
+ raise @error_queue
29
+ end
27
30
  ensure
28
31
  @error_queue = nil
29
32
  end
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '3.0.7'
2
+ VERSION = '3.0.8'
3
3
  end
@@ -483,7 +483,7 @@ module TestCentricity
483
483
  #
484
484
  # @param seconds [Integer or Float] wait time in seconds
485
485
  # @example
486
- # verifying_page.wait_until_gone(15)
486
+ # payment_processing_page.wait_until_gone(15)
487
487
  #
488
488
  def wait_until_gone(seconds = nil)
489
489
  timeout = seconds.nil? ? Capybara.default_max_wait_time : seconds
@@ -493,6 +493,23 @@ module TestCentricity
493
493
  raise "Page object #{self.class.name} remained visible after #{timeout} seconds" if exists?
494
494
  end
495
495
 
496
+ # Wait until all AJAX requests have completed, or until the specified wait time has expired. If the wait time is nil, then
497
+ # the wait time will be Capybara.default_max_wait_time.
498
+ #
499
+ # @param seconds [Integer or Float] wait time in seconds
500
+ # @example
501
+ # shopping_basket_page.wait_for_ajax(15)
502
+ #
503
+ def wait_for_ajax(seconds = nil)
504
+ wait_time = seconds.nil? ? Capybara.default_max_wait_time : seconds
505
+ Timeout.timeout(wait_time) do
506
+ loop do
507
+ active = page.evaluate_script('jQuery.active')
508
+ break if active == 0
509
+ end
510
+ end
511
+ end
512
+
496
513
  # Is current Page object URL secure?
497
514
  #
498
515
  # @return [Boolean]
@@ -503,7 +520,7 @@ module TestCentricity
503
520
  !current_url.match(/^https/).nil?
504
521
  end
505
522
 
506
- def verify_ui_states(ui_states)
523
+ def verify_ui_states(ui_states, fail_message = nil)
507
524
  ui_states.each do |ui_object, object_states|
508
525
  object_states.each do |property, state|
509
526
  case property
@@ -607,7 +624,7 @@ module TestCentricity
607
624
  rescue ObjectNotFoundError => e
608
625
  ExceptionQueue.enqueue_exception(e.message)
609
626
  ensure
610
- ExceptionQueue.post_exceptions
627
+ ExceptionQueue.post_exceptions(fail_message)
611
628
  end
612
629
 
613
630
  # Populate the specified UI elements on this page with the associated data from a Hash passed as an argument. Data
@@ -695,7 +695,7 @@ module TestCentricity
695
695
  section.send_keys(*keys)
696
696
  end
697
697
 
698
- def verify_ui_states(ui_states)
698
+ def verify_ui_states(ui_states, fail_message = nil)
699
699
  ui_states.each do |ui_object, object_states|
700
700
  object_states.each do |property, state|
701
701
  case property
@@ -799,7 +799,7 @@ module TestCentricity
799
799
  rescue ObjectNotFoundError => e
800
800
  ExceptionQueue.enqueue_exception(e.message)
801
801
  ensure
802
- ExceptionQueue.post_exceptions
802
+ ExceptionQueue.post_exceptions(fail_message)
803
803
  end
804
804
 
805
805
  # Populate the specified UI elements in this Section object with the associated data from a Hash passed as an
@@ -31,13 +31,13 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency 'bundler', '~> 1.5'
32
32
  spec.add_development_dependency 'rake'
33
33
 
34
- spec.add_runtime_dependency 'capybara'
34
+ spec.add_runtime_dependency 'capybara', '>= 3.1', '< 4'
35
35
  spec.add_runtime_dependency 'test-unit'
36
36
  spec.add_runtime_dependency 'selenium-webdriver', ['>= 3.11.0', '< 4.0']
37
37
  spec.add_runtime_dependency 'faker'
38
38
  spec.add_runtime_dependency 'chronic', '0.10.2'
39
39
  spec.add_runtime_dependency 'spreadsheet', '1.1.1'
40
- spec.add_runtime_dependency 'os'
40
+ spec.add_runtime_dependency 'os', '~> 1.0'
41
41
  spec.add_runtime_dependency 'i18n'
42
42
  spec.add_runtime_dependency 'browserstack-local'
43
43
  spec.add_runtime_dependency 'appium_lib'
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.0.7
4
+ version: 3.0.8
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: 2018-06-21 00:00:00.000000000 Z
11
+ date: 2018-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,14 +44,20 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '3.1'
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: '4'
48
51
  type: :runtime
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
52
55
  - - ">="
53
56
  - !ruby/object:Gem::Version
54
- version: '0'
57
+ version: '3.1'
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: '4'
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: test-unit
57
63
  requirement: !ruby/object:Gem::Requirement
@@ -132,16 +138,16 @@ dependencies:
132
138
  name: os
133
139
  requirement: !ruby/object:Gem::Requirement
134
140
  requirements:
135
- - - ">="
141
+ - - "~>"
136
142
  - !ruby/object:Gem::Version
137
- version: '0'
143
+ version: '1.0'
138
144
  type: :runtime
139
145
  prerelease: false
140
146
  version_requirements: !ruby/object:Gem::Requirement
141
147
  requirements:
142
- - - ">="
148
+ - - "~>"
143
149
  - !ruby/object:Gem::Version
144
- version: '0'
150
+ version: '1.0'
145
151
  - !ruby/object:Gem::Dependency
146
152
  name: i18n
147
153
  requirement: !ruby/object:Gem::Requirement