testcentricity_web 2.3.12 → 2.3.14

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: 982d0553ec5b4a2185dfb9d4765c68effda6f086
4
- data.tar.gz: e6a5ebd02a02ff05e0e4915423d6d79b36683958
3
+ metadata.gz: 9d2755f36849e6612ba5941ae5bb657c0c897f59
4
+ data.tar.gz: d6dea5afbb885495a6da0a10e8c0515fcf68d80d
5
5
  SHA512:
6
- metadata.gz: f6f7cec00a765749ad9a93be59cd64a24ed98f2a701de6960b927a5a5944a0330e11c1227adb417964dc50d7de71e81af7ab8d10f4137a870944972edb4284e5
7
- data.tar.gz: 612f51617b5e5ab74e01051a11a11c57442cde08a305e335c752d5535961947bd1a8d694e145ba01207269b12f9d7095b8ded384520daed97a3d08470dd7d5f8
6
+ metadata.gz: fa50b0635c96c78c8d102b9b973dd8b4a39e31412bd192363ced7bd6cd2beaf34108dd5ec4c59a555978c31e6e8c6e52d0165529e9924074e498bac3cf9dbb7c
7
+ data.tar.gz: 0ebd62231027aa420058d80224e5022f65f45d0861a63468b078073d190b45a475e6498d8c006b7cea91f9766b33547c994f01e0ccf59f09fbfc0b8bdd09e2c6
data/README.md CHANGED
@@ -28,6 +28,15 @@ hosted instances of Chrome, Firefox, Safari, and IE web browsers.
28
28
 
29
29
 
30
30
  ## What's New
31
+ ###Version 2.3.14
32
+
33
+ * Updated device profiles for iPhone 7 (iOS 10) with MS Edge browser.
34
+
35
+ ###Version 2.3.13
36
+
37
+ * Added `AppiumServer.start`, `AppiumServer.running?`, and `AppiumServer.stop` methods for starting and stopping the Appium Server prior to executing tests on
38
+ iOS physical devices or simulators, or Android virtual device emulators.
39
+
31
40
  ###Version 2.3.12
32
41
 
33
42
  * Added `Environ.is_simulator?` and `Environ.is_web?` methods.
@@ -77,7 +77,7 @@
77
77
  :css_width: 375
78
78
  :css_height: 667
79
79
  :default_orientation: portrait
80
- :user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.0 EdgiOS/41.9.0.0 Mobile/14G60 Safari/603.3.8"
80
+ :user_agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.0 EdgiOS/41.10.1.0 Mobile/14G60 Safari/603.3.8"
81
81
  :iphone8:
82
82
  :name: "iPhone 8"
83
83
  :os: ios
@@ -37,6 +37,7 @@ require 'testcentricity_web/web_elements/list_element'
37
37
  require 'testcentricity_web/web_elements/list_button'
38
38
  require 'testcentricity_web/web_elements/list_checkbox'
39
39
  require 'testcentricity_web/web_elements/list_radio'
40
+ require 'testcentricity_web/appium_server'
40
41
 
41
42
 
42
43
  module TestCentricity
@@ -0,0 +1,69 @@
1
+ require 'childprocess'
2
+
3
+ #
4
+ # This class is designed to start and stop the Appium Server process. In order to use it you must have Appium
5
+ # and node installed on your computer. You can pass parameters to Appium at startup via the constructor.
6
+ #
7
+ module TestCentricity
8
+ class AppiumServer
9
+
10
+ attr_accessor :process
11
+
12
+ def initialize(params={})
13
+ @params = params
14
+ end
15
+
16
+ #
17
+ # Start the Appium Server
18
+ #
19
+ def start
20
+ # terminate any currently running Appium Server
21
+ if running?
22
+ system('killall -9 node')
23
+ puts 'Terminating existing Appium Server'
24
+ sleep(5)
25
+ puts 'Appium Server is being restarted'
26
+ else
27
+ puts 'Appium Server is being started'
28
+ end
29
+ # start new Appium Server
30
+ @process = ChildProcess.build(*parameters)
31
+ process.start
32
+ # wait until confirmation that Appium Server is running
33
+ wait = Selenium::WebDriver::Wait.new(timeout: 30)
34
+ wait.until { running? }
35
+ puts "Appium Server is running - PID = #{process.pid}"
36
+ end
37
+
38
+ #
39
+ # Check to see if Appium Server is running
40
+ #
41
+ def running?
42
+ response = nil
43
+ begin
44
+ response = Net::HTTP.get_response(URI('http://127.0.0.1:4723/wd/hub/sessions'))
45
+ rescue
46
+ end
47
+ response && response.code_type == Net::HTTPOK
48
+ end
49
+
50
+ #
51
+ # Stop the Appium Server
52
+ #
53
+ def stop
54
+ process.stop
55
+ puts 'Appium Server has been terminated'
56
+ end
57
+
58
+ private
59
+
60
+ def parameters
61
+ cmd = ['appium']
62
+ @params.each do |key, value|
63
+ cmd << '--' + key.to_s
64
+ cmd << value.to_s if not value.nil? and value.size > 0
65
+ end
66
+ cmd
67
+ end
68
+ end
69
+ end
@@ -410,6 +410,7 @@ module TestCentricity
410
410
  error_message = "#{error_message}\nExpected URL of page was #{page_url}." if defined?(page_url)
411
411
  raise error_message
412
412
  end
413
+ PageManager.current_page = self
413
414
  end
414
415
 
415
416
  def navigate_to; end
@@ -428,7 +429,6 @@ module TestCentricity
428
429
  navigate_to
429
430
  end
430
431
  verify_page_exists
431
- PageManager.current_page = self
432
432
  end
433
433
 
434
434
  def verify_page_contains(content)
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '2.3.12'
2
+ VERSION = '2.3.14'
3
3
  end
@@ -51,7 +51,7 @@ module TestCentricity
51
51
  end
52
52
 
53
53
  # set browser window size only if testing with a desktop web browser
54
- unless Environ.is_device? || Capybara.current_driver == :poltergeist
54
+ unless Environ.is_device? || [:poltergeist, :appium].include?(Capybara.current_driver)
55
55
  initialize_browser_size
56
56
  end
57
57
 
@@ -41,4 +41,6 @@ Gem::Specification.new do |spec|
41
41
  spec.add_dependency 'os'
42
42
  spec.add_dependency 'i18n'
43
43
  spec.add_dependency 'browserstack-local'
44
+
45
+ spec.add_runtime_dependency 'childprocess', '~> 0.5'
44
46
  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: 2.3.12
4
+ version: 2.3.14
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-02-07 00:00:00.000000000 Z
11
+ date: 2018-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -190,6 +190,20 @@ dependencies:
190
190
  - - ">="
191
191
  - !ruby/object:Gem::Version
192
192
  version: '0'
193
+ - !ruby/object:Gem::Dependency
194
+ name: childprocess
195
+ requirement: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - "~>"
198
+ - !ruby/object:Gem::Version
199
+ version: '0.5'
200
+ type: :runtime
201
+ prerelease: false
202
+ version_requirements: !ruby/object:Gem::Requirement
203
+ requirements:
204
+ - - "~>"
205
+ - !ruby/object:Gem::Version
206
+ version: '0.5'
193
207
  description: |2-
194
208
 
195
209
  The TestCentricity™ Web core generic framework for desktop and mobile web site testing implements a Page Object Model DSL
@@ -219,6 +233,7 @@ files:
219
233
  - Rakefile
220
234
  - lib/devices/devices.yml
221
235
  - lib/testcentricity_web.rb
236
+ - lib/testcentricity_web/appium_server.rb
222
237
  - lib/testcentricity_web/browser_helper.rb
223
238
  - lib/testcentricity_web/data_objects_helper.rb
224
239
  - lib/testcentricity_web/drag_drop_helper.rb