testcentricity_web 2.2.1 → 2.3.0

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: a22d10e0a98ccb67cbad9cbd9b53ec13aca5e5a8
4
- data.tar.gz: 080382fb259e781f11dbdd2482273c990dc89abc
3
+ metadata.gz: ad3e1644f9aadc806902d2980e39b0082cca13df
4
+ data.tar.gz: 554500bbda1bd296e2d8b7607d6f513fb050c7c6
5
5
  SHA512:
6
- metadata.gz: 8deb7b3f53d6e059a1fecceb37054b8818b28c1f50c627769d6b2e0e21fa6acc9e4ce3d0b99423cabafb1da729b3b396fdfebf31b3031b8c236db48dc1b22cf5
7
- data.tar.gz: 6b504a926fb6d58edd47331207fb5af0185eba4d84eb50f0eac39be82e7193ad836606fa74665e8226a60253cb9a3733f6c77802a51317ec28eb1ca067f9957b
6
+ metadata.gz: 8468742f8cf244605a697cb536fe4b6c10fdac707df726b0251c7e8a4ccb8d37ff64a2e1592cfdf1c4afe7f1c25db631c44bbd3310b62c80c8a9f48d56f27caa
7
+ data.tar.gz: 7b5a456238bf4c3fbffb9e0dc347540cb481abcab88f1d4456c0c218bae8cc3d65aa3da339bb7ae84858bffc43af26b1f39dcffc0b67019e98831f2da7f7cfeb
data/README.md CHANGED
@@ -24,6 +24,14 @@ feature incomplete and potentially unstable. More information can be found [here
24
24
 
25
25
  ## What's New
26
26
 
27
+ ###Version 2.3.0
28
+
29
+ * When testing using the remotely hosted browsers on the BrowserStack service, the BrowserStack Local instance is automatically started if the `TUNNELING`
30
+ Environment Variable is set to `true`. `Environ.tunneling` will be set to true if the BrowserStack Local instance is succesfully started. Requires the
31
+ [browserstack-local gem](https://rubygems.org/gems/browserstack-local).
32
+ * Added `TestCentricity::WebDriverConnect.close_tunnel` method to close BrowserStack Local instance when Local testing is enabled. Refer to the
33
+ **Remotely hosted desktop and mobile web browsers** section for information on usage.
34
+
27
35
  ###Version 2.2.0
28
36
 
29
37
  * CSS selectors or XPath expressions may be used as locators for all types of **UI Elements**, including tables.
@@ -57,7 +65,7 @@ for textfields.
57
65
 
58
66
  * Added support for "tiling" or cascading multiple browser windows when the `BROWSER_TILE` and `PARALLEL` Environment Variables are set to true. For each
59
67
  concurrent parallel thread being executed, the position of each browser will be offset by 100 pixels right and 100 pixels down. For parallel test execution,
60
- use the [parallel_tests gem](https://github.com/grosser/parallel_tests) to decrease overall test execution time.
68
+ use the [parallel_tests gem](https://rubygems.org/gems/parallel_tests) to decrease overall test execution time.
61
69
 
62
70
  ###Version 2.1.2
63
71
 
@@ -74,6 +82,10 @@ use the [parallel_tests gem](https://github.com/grosser/parallel_tests) to decre
74
82
 
75
83
 
76
84
  ## What's Fixed
85
+ ###Version 2.2.1
86
+
87
+ * `SelectList.choose_option` method now accepts index values for Chosen list objects.
88
+
77
89
  ###Version 2.1.9
78
90
 
79
91
  * Fixed bug in `SelectList.choose_option`, `SelectList.get_options`, `SelectList.get_option_count`, and `SelectList.get_selected_option` methods which
@@ -889,12 +901,20 @@ for information regarding the specific capabilities.
889
901
  `BS_OS_VERSION` | Refer to `os_version` capability in chart
890
902
  `BS_BROWSER` | Refer to `browser` capability in chart
891
903
  `BS_VERSION` | [Optional] Refer to `browser_version` capability in chart. If not specified, latest stable version of browser will be used.
892
- `TUNNELING` | Must be `true` if you are testing against internal/local servers (`true` or `false`)
904
+ `TUNNELING` | Must be `true` if you are testing against internal/local servers (`true` or `false`). If `true`, the BrowserStack Local instance will be automatically started.
893
905
  `RESOLUTION` | [Optional] Refer to supported screen `resolution` capability in chart
894
906
  `BROWSER_SIZE` | [Optional] Specify width, height of browser window
895
907
  `RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`)
896
908
  `TIME_ZONE` | [Optional] Specify custom time zone. Refer to `browserstack.timezone` capability in chart
897
909
 
910
+ If the BrowserStack Local instance is running (`TUNNELING` Environment Variable is `true`), call the`TestCentricity::WebDriverConnect.close_tunnel` method
911
+ upon completion of your test suite to stop the Local instance. Place the code shown below in your `env.rb` file.
912
+
913
+ # Code to stop BrowserStack Local instance after end of test (if tunneling is enabled)
914
+ at_exit do
915
+ TestCentricity::WebDriverConnect.close_tunnel if Environ.tunneling
916
+ end
917
+
898
918
 
899
919
  #### Remote mobile browsers on the BrowserStack service
900
920
 
@@ -912,7 +932,7 @@ for information regarding the specific capabilities.
912
932
  `BS_PLATFORM` | Must be set to `MAC` (for iOS) or `ANDROID`
913
933
  `BS_DEVICE` | Refer to `device` capability in chart
914
934
  `BS_REAL_MOBILE` | Set to `true` if running against a real device
915
- `TUNNELING` | Must be `true` if you are testing against internal/local servers (`true` or `false`)
935
+ `TUNNELING` | Must be `true` if you are testing against internal/local servers (`true` or `false`). If `true`, the BrowserStack Local instance will be automatically started.
916
936
  `ORIENTATION` | [Optional] Set to `portrait` or `landscape`
917
937
  `RECORD_VIDEO` | [Optional] Enable screen video recording during test execution (`true` or `false`)
918
938
  `TIME_ZONE` | [Optional] Specify custom time zone. Refer to `browserstack.timezone` capability in chart
@@ -37,6 +37,7 @@ module TestCentricity
37
37
  attr_accessor :device_os
38
38
  attr_accessor :device_orientation
39
39
  attr_accessor :platform
40
+ attr_accessor :tunneling
40
41
 
41
42
  attr_accessor :signed_in
42
43
  attr_accessor :portal_status
@@ -190,6 +191,14 @@ module TestCentricity
190
191
  @device_orientation
191
192
  end
192
193
 
194
+ def self.tunneling=(state)
195
+ @tunneling = state
196
+ end
197
+
198
+ def self.tunneling
199
+ @tunneling
200
+ end
201
+
193
202
  # @deprecated Please use {#platform=} instead
194
203
  def self.set_platform(platform)
195
204
  warn "[DEPRECATION] 'TestCentricity::Environ.set_platform' is deprecated. Please use 'Environ.platform =' instead."
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '2.2.1'
2
+ VERSION = '2.3.0'
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require 'selenium-webdriver'
2
2
  require 'os'
3
+ require 'browserstack/local'
3
4
 
4
5
 
5
6
  module TestCentricity
@@ -7,6 +8,7 @@ module TestCentricity
7
8
  include Capybara::DSL
8
9
 
9
10
  attr_accessor :webdriver_path
11
+ attr_accessor :bs_local
10
12
 
11
13
  def self.initialize_web_driver(app_host = nil)
12
14
  Capybara.app_host = app_host unless app_host.nil?
@@ -150,6 +152,17 @@ module TestCentricity
150
152
  Environ.session_state = :running
151
153
  end
152
154
 
155
+ def self.close_tunnel
156
+ unless @bs_local.nil?
157
+ @bs_local.stop
158
+ if @bs_local.isRunning
159
+ raise 'BrowserStack Local instance could not be stopped'
160
+ else
161
+ puts 'BrowserStack Local instance has been stopped'
162
+ end
163
+ end
164
+ end
165
+
153
166
  private
154
167
 
155
168
  def self.initialize_appium
@@ -375,10 +388,23 @@ module TestCentricity
375
388
  capabilities['javascriptEnabled'] = 'true'
376
389
  capabilities['cleanSession'] = 'true'
377
390
  end
391
+
392
+ if ENV['TUNNELING']
393
+ @bs_local = BrowserStack::Local.new
394
+ bs_local_args = {'key' => "#{ENV['BS_AUTHKEY']}"}
395
+ @bs_local.start(bs_local_args)
396
+ if @bs_local.isRunning
397
+ puts 'BrowserStack Local instance has been started'
398
+ else
399
+ puts 'BrowserStack Local instance failed to start'
400
+ end
401
+ end
402
+
378
403
  Capybara::Selenium::Driver.new(app, browser: :remote, url: endpoint, desired_capabilities: capabilities)
379
404
  end
380
405
 
381
406
  Environ.browser = browser
407
+ Environ.tunneling = ENV['TUNNELING'] if ENV['TUNNELING']
382
408
 
383
409
  Capybara.default_driver = :browserstack
384
410
  Capybara.run_server = false
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: 2.2.1
4
+ version: 2.3.0
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: 2017-11-29 00:00:00.000000000 Z
11
+ date: 2017-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler