testcentricity_web 3.2.10 → 3.2.11

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
  SHA256:
3
- metadata.gz: 8c960c3cb1d61f00e5033a577f594fef654b8f3b3e78f041d7b3829f6c820397
4
- data.tar.gz: 7ec8adf8bf2fe279204b1f82eecb8425436a87722c9745551fef5aabc8e6423d
3
+ metadata.gz: cec5c9aa72cd0a6772b8ac1fd96174fdddc3cda8753fd2260b5271edbeb7fa7a
4
+ data.tar.gz: 0e995b14b3894a98a0f9c1d93e20f8c49425259e5c788ae0e3fc1ba84069e560
5
5
  SHA512:
6
- metadata.gz: b8795c42204318d82d5892335a2d19f15e812db27b85fc428f38d9d7656088e784f2ab8d99fc941b2e0e62dfbceaba7c99291740353a336bc457737be26be494
7
- data.tar.gz: 381ae2599c26f4a5a80e2dc99e1becbea45e481dd0b8d788ab962af3b43df025cde5660291b03ba53112d90381fca087b283ab6a92859fb9e574ed2bbf1b3e42
6
+ metadata.gz: f07d3e3e852c1dee34b85e4698980006237ac09abb6844ba83a60fa20e3ae2faf4c5aaaeeb66ac2f7357a45e948cfad38b50391e2a625a8de16568976a7b07fa
7
+ data.tar.gz: ab98d66b6b4f73db2c73fcda34fca9d84af521f30acb340a49ab6cd2383cab0721171194d2fcc5be380f4e3be0310e3342573c5cad3c12a494ad556d0706d97c
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # CHANGELOG
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [3.2.11] - 10-MAR-2020
5
+
6
+ ### Added
7
+ * Added `PageSection.verify_focus_order`method.
8
+
4
9
  ## [3.2.10] - 09-MAR-2020
5
10
 
6
11
  ### Added
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '3.2.10'
2
+ VERSION = '3.2.11'
3
3
  end
@@ -546,30 +546,8 @@ module TestCentricity
546
546
  current_url.start_with?('https')
547
547
  end
548
548
 
549
- def verify_focus_order(order)
550
- order.each do |expected_element|
551
- if expected_element.is_a?(Array)
552
- expected_element.each do |sub_element|
553
- set_verify_focus(:arrow_right, sub_element)
554
- end
555
- else
556
- set_verify_focus(:tab, expected_element)
557
- end
558
- end
559
- end
560
-
561
549
  private
562
550
 
563
- def set_verify_focus(key, expected_element)
564
- page.driver.browser.action.send_keys(key).perform
565
- sleep(0.5)
566
- focused_obj = page.driver.browser.switch_to.active_element
567
- expected_obj = page.find(expected_element.get_locator_type, expected_element.get_locator, wait: 0.01, visible: :all).native
568
- raise "Expected element '#{expected_element.get_name}' to have focus" unless focused_obj == expected_obj
569
-
570
- puts "Element '#{expected_element.get_name}' is focused as expected"
571
- end
572
-
573
551
  def self.define_page_element(element_name, obj, locator)
574
552
  define_method(element_name) do
575
553
  ivar_name = "@#{element_name}"
@@ -300,5 +300,28 @@ module TestCentricity
300
300
  end
301
301
  end
302
302
  end
303
- end
303
+
304
+ def verify_focus_order(order)
305
+ order.each do |expected_element|
306
+ if expected_element.is_a?(Array)
307
+ expected_element.each do |sub_element|
308
+ set_verify_focus(:arrow_right, sub_element)
309
+ end
310
+ else
311
+ set_verify_focus(:tab, expected_element)
312
+ end
313
+ end
314
+ end
315
+
316
+ private
317
+
318
+ def set_verify_focus(key, expected_element)
319
+ page.driver.browser.action.send_keys(key).perform
320
+ sleep(0.5)
321
+ focused_obj = page.driver.browser.switch_to.active_element
322
+ expected_obj, = expected_element.find_element(visible = :all)
323
+ raise "Expected element '#{expected_element.get_name}' to have focus but found '#{focused_obj.id} is focused instead'" unless focused_obj == expected_obj.native
324
+
325
+ puts "Element '#{expected_element.get_name}' is focused as expected"
326
+ end end
304
327
  end
@@ -957,13 +957,13 @@ module TestCentricity
957
957
  obj.native.attribute(attrib)
958
958
  end
959
959
 
960
- private
961
-
962
960
  def find_element(visible = true)
963
961
  wait = Selenium::WebDriver::Wait.new(timeout: Capybara.default_max_wait_time)
964
962
  wait.until { find_object(visible) }
965
963
  end
966
964
 
965
+ private
966
+
967
967
  def find_object(visible = true)
968
968
  obj_locator = @alt_locator.nil? ? @locator : @alt_locator
969
969
  parent_section = @context == :section && !@parent.get_locator.nil?
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.2.10
4
+ version: 3.2.11
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: 2020-03-09 00:00:00.000000000 Z
11
+ date: 2020-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -253,7 +253,6 @@ files:
253
253
  - CHANGELOG.md
254
254
  - CODE_OF_CONDUCT.md
255
255
  - Gemfile
256
- - Gemfile.lock
257
256
  - LICENSE.md
258
257
  - README.md
259
258
  - Rakefile
data/Gemfile.lock DELETED
@@ -1,112 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- testcentricity_web (3.2.10)
5
- appium_lib
6
- browserstack-local
7
- capybara (>= 3.1, < 4)
8
- childprocess (~> 0.5)
9
- chronic (= 0.10.2)
10
- faker
11
- i18n
12
- os (~> 1.0)
13
- selenium-webdriver
14
- spreadsheet (= 1.1.7)
15
- test-unit
16
- virtus
17
- webdrivers (~> 4.0)
18
-
19
- GEM
20
- remote: https://rubygems.org/
21
- specs:
22
- addressable (2.7.0)
23
- public_suffix (>= 2.0.2, < 5.0)
24
- appium_lib (10.5.0)
25
- appium_lib_core (~> 3.3)
26
- nokogiri (~> 1.8, >= 1.8.1)
27
- tomlrb (~> 1.1)
28
- appium_lib_core (3.5.0)
29
- faye-websocket (~> 0.10.0)
30
- selenium-webdriver (~> 3.14, >= 3.14.1)
31
- axiom-types (0.1.1)
32
- descendants_tracker (~> 0.0.4)
33
- ice_nine (~> 0.11.0)
34
- thread_safe (~> 0.3, >= 0.3.1)
35
- browserstack-local (1.3.0)
36
- capybara (3.31.0)
37
- addressable
38
- mini_mime (>= 0.1.3)
39
- nokogiri (~> 1.8)
40
- rack (>= 1.6.0)
41
- rack-test (>= 0.6.3)
42
- regexp_parser (~> 1.5)
43
- xpath (~> 3.2)
44
- childprocess (0.9.0)
45
- ffi (~> 1.0, >= 1.0.11)
46
- chronic (0.10.2)
47
- coercible (1.0.0)
48
- descendants_tracker (~> 0.0.1)
49
- concurrent-ruby (1.1.5)
50
- descendants_tracker (0.0.4)
51
- thread_safe (~> 0.3, >= 0.3.1)
52
- equalizer (0.0.11)
53
- eventmachine (1.2.7)
54
- faker (2.10.1)
55
- i18n (>= 1.6, < 2)
56
- faye-websocket (0.10.9)
57
- eventmachine (>= 0.12.0)
58
- websocket-driver (>= 0.5.1)
59
- ffi (1.12.2)
60
- i18n (1.8.2)
61
- concurrent-ruby (~> 1.0)
62
- ice_nine (0.11.2)
63
- mini_mime (1.0.2)
64
- mini_portile2 (2.4.0)
65
- nokogiri (1.10.7)
66
- mini_portile2 (~> 2.4.0)
67
- os (1.0.1)
68
- power_assert (1.1.5)
69
- public_suffix (4.0.3)
70
- rack (2.2.0)
71
- rack-test (1.1.0)
72
- rack (>= 1.0, < 3)
73
- rake (13.0.1)
74
- redcarpet (3.5.0)
75
- regexp_parser (1.6.0)
76
- ruby-ole (1.2.12.2)
77
- rubyzip (2.2.0)
78
- selenium-webdriver (3.142.7)
79
- childprocess (>= 0.5, < 4.0)
80
- rubyzip (>= 1.2.2)
81
- spreadsheet (1.1.7)
82
- ruby-ole (>= 1.0)
83
- test-unit (3.3.5)
84
- power_assert
85
- thread_safe (0.3.6)
86
- tomlrb (1.2.9)
87
- virtus (1.0.5)
88
- axiom-types (~> 0.1)
89
- coercible (~> 1.0)
90
- descendants_tracker (~> 0.0, >= 0.0.3)
91
- equalizer (~> 0.0, >= 0.0.9)
92
- webdrivers (4.2.0)
93
- nokogiri (~> 1.6)
94
- rubyzip (>= 1.3.0)
95
- selenium-webdriver (>= 3.0, < 4.0)
96
- websocket-driver (0.7.1)
97
- websocket-extensions (>= 0.1.0)
98
- websocket-extensions (0.1.4)
99
- xpath (3.2.0)
100
- nokogiri (~> 1.8)
101
-
102
- PLATFORMS
103
- ruby
104
-
105
- DEPENDENCIES
106
- bundler
107
- rake
108
- redcarpet
109
- testcentricity_web!
110
-
111
- BUNDLED WITH
112
- 2.1.4