testcentricity_web 1.0.16 → 1.0.17

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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -0
  3. data/.rubocop.yml +41 -0
  4. data/.yardopts +0 -0
  5. data/Gemfile +0 -0
  6. data/LICENSE.txt +0 -0
  7. data/README.md +9 -3
  8. data/Rakefile +0 -0
  9. data/lib/devices/devices.yml +0 -0
  10. data/lib/testcentricity_web.rb +16 -6
  11. data/lib/testcentricity_web/browser_helper.rb +6 -6
  12. data/lib/testcentricity_web/elements/button.rb +0 -0
  13. data/lib/testcentricity_web/elements/checkbox.rb +4 -4
  14. data/lib/testcentricity_web/elements/file_field.rb +1 -1
  15. data/lib/testcentricity_web/elements/image.rb +1 -1
  16. data/lib/testcentricity_web/elements/label.rb +0 -0
  17. data/lib/testcentricity_web/elements/link.rb +0 -0
  18. data/lib/testcentricity_web/elements/list.rb +5 -5
  19. data/lib/testcentricity_web/elements/radio.rb +3 -3
  20. data/lib/testcentricity_web/elements/select_list.rb +16 -16
  21. data/lib/testcentricity_web/elements/table.rb +3 -4
  22. data/lib/testcentricity_web/elements/textfield.rb +4 -4
  23. data/lib/testcentricity_web/environment.rb +30 -2
  24. data/lib/testcentricity_web/excel_helper.rb +12 -12
  25. data/lib/testcentricity_web/exception_queue_helper.rb +1 -1
  26. data/lib/testcentricity_web/page_objects_helper.rb +102 -102
  27. data/lib/testcentricity_web/page_sections_helper.rb +112 -112
  28. data/lib/testcentricity_web/siebel_open_ui_helper.rb +1 -1
  29. data/lib/testcentricity_web/ui_elements_helper.rb +45 -45
  30. data/lib/testcentricity_web/utility_helpers.rb +0 -0
  31. data/lib/testcentricity_web/version.rb +1 -1
  32. data/lib/testcentricity_web/webdriver_helper.rb +79 -70
  33. data/lib/testcentricity_web/world_extensions.rb +0 -0
  34. data/testcentricity_web.gemspec +1 -0
  35. metadata +5 -3
File without changes
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '1.0.16'
2
+ VERSION = '1.0.17'
3
3
  end
@@ -11,38 +11,38 @@ module TestCentricity
11
11
  browser = ENV['WEB_BROWSER']
12
12
 
13
13
  # assume that we're testing within a local desktop web browser
14
- Environ.set_platform(:desktop)
15
- Environ.set_browser(browser)
16
- Environ.set_device(false)
17
- Environ.set_device_type('browser')
14
+ Environ.platform = :desktop
15
+ Environ.browser = browser
16
+ Environ.device = false
17
+ Environ.device_type = 'browser'
18
18
 
19
19
  case browser.downcase.to_sym
20
- when :appium
21
- initialize_appium
22
- context = 'mobile device emulator'
23
- when :browserstack
24
- initialize_browserstack
25
- context = 'Browserstack cloud service'
26
- when :crossbrowser
27
- initialize_crossbrowser
28
- context = 'CrossBrowserTesting cloud service'
29
- when :poltergeist
30
- initialize_poltergeist
31
- context = 'PhantomJS'
32
- when :saucelabs
33
- initialize_saucelabs
34
- context = 'Sauce Labs cloud service'
35
- when :testingbot
36
- initialize_testingbot
37
- context = 'TestingBot cloud service'
20
+ when :appium
21
+ initialize_appium
22
+ context = 'mobile device emulator'
23
+ when :browserstack
24
+ initialize_browserstack
25
+ context = 'Browserstack cloud service'
26
+ when :crossbrowser
27
+ initialize_crossbrowser
28
+ context = 'CrossBrowserTesting cloud service'
29
+ when :poltergeist
30
+ initialize_poltergeist
31
+ context = 'PhantomJS'
32
+ when :saucelabs
33
+ initialize_saucelabs
34
+ context = 'Sauce Labs cloud service'
35
+ when :testingbot
36
+ initialize_testingbot
37
+ context = 'TestingBot cloud service'
38
+ else
39
+ if ENV['SELENIUM'] == 'remote'
40
+ initialize_remote
41
+ context = 'Selenium Grid2'
38
42
  else
39
- if ENV['SELENIUM'] == 'remote'
40
- initialize_remote
41
- context = 'Selenium Grid2'
42
- else
43
- initialize_local_browser
44
- context = 'local instance'
45
- end
43
+ initialize_local_browser
44
+ context = 'local instance'
45
+ end
46
46
  end
47
47
 
48
48
  # set browser window size only if testing with a desktop web browser
@@ -50,7 +50,7 @@ module TestCentricity
50
50
  initialize_browser_size
51
51
  end
52
52
 
53
- puts "Using #{Environ.browser.to_s} browser via #{context}"
53
+ puts "Using #{Environ.browser} browser via #{context}"
54
54
  end
55
55
 
56
56
  def self.set_domain(url)
@@ -60,30 +60,39 @@ module TestCentricity
60
60
  # Set the WebDriver path for Chrome, IE, or Edge browsers
61
61
  def self.set_webdriver_path(project_path)
62
62
  path_to_driver = nil
63
+ # check for existence of /webdrivers or /features/support/drivers folders
64
+ base_path = 'features/support/drivers'
65
+ unless File.directory?(File.join(project_path, base_path))
66
+ base_path = 'webdrivers'
67
+ unless File.directory?(File.join(project_path, base_path))
68
+ raise 'Could not find WebDriver files in /webdrivers or /features/support/drivers folders'
69
+ end
70
+ end
71
+ # set WebDriver path based on browser and operating system
63
72
  case ENV['WEB_BROWSER'].downcase.to_sym
64
- when :chrome
65
- if OS.osx?
66
- path_to_driver = 'features/support/drivers/mac/chromedriver'
67
- elsif OS.windows?
68
- path_to_driver = 'features/support/drivers/windows/chromedriver.exe'
69
- end
70
- Selenium::WebDriver::Chrome.driver_path = File.join(project_path, path_to_driver)
71
- when :ie
72
- path_to_driver = 'features/support/drivers/windows/IEDriverServer.exe'
73
- Selenium::WebDriver::IE.driver_path = File.join(project_path, path_to_driver)
74
- when :edge
75
- path_to_driver = 'features/support/drivers/windows/MicrosoftWebDriver.exe'
76
- Selenium::WebDriver::Edge.driver_path = File.join(project_path, path_to_driver)
73
+ when :chrome
74
+ if OS.osx?
75
+ path_to_driver = 'mac/chromedriver'
76
+ elsif OS.windows?
77
+ path_to_driver = 'windows/chromedriver.exe'
78
+ end
79
+ Selenium::WebDriver::Chrome.driver_path = File.join(project_path, base_path, path_to_driver)
80
+ when :ie
81
+ path_to_driver = 'windows/IEDriverServer.exe'
82
+ Selenium::WebDriver::IE.driver_path = File.join(project_path, base_path, path_to_driver)
83
+ when :edge
84
+ path_to_driver = 'windows/MicrosoftWebDriver.exe'
85
+ Selenium::WebDriver::Edge.driver_path = File.join(project_path, base_path, path_to_driver)
77
86
  end
78
- puts "The webdriver path is: #{path_to_driver}" unless path_to_driver.nil?
87
+ puts "The webdriver path is: #{File.join(project_path, base_path, path_to_driver)}" unless path_to_driver.nil?
79
88
  end
80
89
 
81
90
  private
82
91
 
83
92
  def self.initialize_appium
84
- Environ.set_device(true)
85
- Environ.set_platform(:mobile)
86
- Environ.set_device_type(ENV['APP_DEVICE'])
93
+ Environ.device = true
94
+ Environ.platform = :mobile
95
+ Environ.device_type = ENV['APP_DEVICE']
87
96
  Capybara.default_driver = :appium
88
97
  endpoint = 'http://localhost:4723/wd/hub'
89
98
  desired_capabilities = {
@@ -120,8 +129,8 @@ module TestCentricity
120
129
  Capybara::Selenium::Driver.new(app, :browser => browser.to_sym)
121
130
  else
122
131
  user_agent = Browsers.mobile_device_agent(browser)
123
- Environ.set_platform(:mobile)
124
- Environ.set_device_type(Browsers.mobile_device_name(browser))
132
+ Environ.platform = :mobile
133
+ Environ.device_type = Browsers.mobile_device_name(browser)
125
134
  ENV['HOST_BROWSER'] ? host_browser = ENV['HOST_BROWSER'].downcase.to_sym : host_browser = :firefox
126
135
  case host_browser
127
136
  when :firefox
@@ -140,14 +149,14 @@ module TestCentricity
140
149
  def self.initialize_browserstack
141
150
  browser = ENV['BS_BROWSER']
142
151
 
143
- endpoint = "http://#{ENV['BS_USERNAME']}:#{ENV['BS_AUTHKEY']}@hub.browserstack.com/wd/hub"
152
+ endpoint = "http://#{ENV['BS_USERNAME']}:#{ENV['BS_AUTHKEY']}@hub-cloud.browserstack.com/wd/hub"
144
153
  Capybara.register_driver :browserstack do |app|
145
154
  capabilities = Selenium::WebDriver::Remote::Capabilities.new
146
155
 
147
156
  if ENV['BS_OS']
148
157
  capabilities['os'] = ENV['BS_OS']
149
158
  capabilities['os_version'] = ENV['BS_OS_VERSION']
150
- Environ.set_os("#{ENV['BS_OS']} #{ENV['BS_OS_VERSION']}")
159
+ Environ.os = "#{ENV['BS_OS']} #{ENV['BS_OS_VERSION']}"
151
160
  capabilities['browser'] = browser || 'chrome'
152
161
  capabilities['browser_version'] = ENV['BS_VERSION'] if ENV['BS_VERSION']
153
162
  capabilities['resolution'] = ENV['RESOLUTION'] if ENV['RESOLUTION']
@@ -155,9 +164,9 @@ module TestCentricity
155
164
  capabilities[:platform] = ENV['BS_PLATFORM']
156
165
  capabilities[:browserName] = browser
157
166
  capabilities['device'] = ENV['BS_DEVICE'] if ENV['BS_DEVICE']
158
- Environ.set_platform(:mobile)
159
- Environ.set_device(true)
160
- Environ.set_device_type(ENV['BS_DEVICE'])
167
+ Environ.platform = :mobile
168
+ Environ.device = true
169
+ Environ.device_type = ENV['BS_DEVICE']
161
170
  capabilities['deviceOrientation'] = ENV['ORIENTATION'] if ENV['ORIENTATION']
162
171
  end
163
172
 
@@ -177,7 +186,7 @@ module TestCentricity
177
186
  when :ie
178
187
  capabilities['ie.ensureCleanSession'] = 'true'
179
188
  capabilities['ie.browserCommandLineSwitches'] = 'true'
180
- capabilities['nativeEvents'] ='true'
189
+ capabilities['nativeEvents'] = 'true'
181
190
  when :safari
182
191
  capabilities['cleanSession'] = 'true'
183
192
  when :iphone, :ipad
@@ -187,7 +196,7 @@ module TestCentricity
187
196
  Capybara::Selenium::Driver.new(app, :browser => :remote, :url => endpoint, :desired_capabilities => capabilities)
188
197
  end
189
198
 
190
- Environ.set_browser(browser)
199
+ Environ.browser = browser
191
200
 
192
201
  Capybara.default_driver = :browserstack
193
202
  Capybara.run_server = false
@@ -205,17 +214,17 @@ module TestCentricity
205
214
  capabilities['screen_resolution'] = ENV['RESOLUTION'] if ENV['RESOLUTION']
206
215
  if ENV['CB_OS']
207
216
  capabilities['os_api_name'] = ENV['CB_OS']
208
- Environ.set_platform(:desktop)
217
+ Environ.platform = :desktop
209
218
  elsif ENV['CB_PLATFORM']
210
219
  capabilities['os_api_name'] = ENV['CB_PLATFORM']
211
- Environ.set_device_type(ENV['CB_PLATFORM'])
212
- Environ.set_device(true)
213
- Environ.set_platform(:mobile)
220
+ Environ.device_type = ENV['CB_PLATFORM']
221
+ Environ.device = true
222
+ Environ.platform = :mobile
214
223
  end
215
224
  Capybara::Selenium::Driver.new(app, :browser => :remote, :url => endpoint, :desired_capabilities => capabilities)
216
225
  end
217
226
 
218
- Environ.set_browser(browser)
227
+ Environ.browser = browser
219
228
 
220
229
  Capybara.default_driver = :crossbrowser
221
230
  Capybara.run_server = false
@@ -269,20 +278,20 @@ module TestCentricity
269
278
  capabilities['recordVideo'] = ENV['RECORD_VIDEO'] if ENV['RECORD_VIDEO']
270
279
  if ENV['SL_OS']
271
280
  capabilities['platform'] = ENV['SL_OS']
272
- Environ.set_platform(:desktop)
281
+ Environ.platform = :desktop
273
282
  elsif ENV['SL_PLATFORM']
274
283
  capabilities['platform'] = ENV['SL_PLATFORM']
275
284
  capabilities['deviceName'] = ENV['SL_DEVICE']
276
285
  capabilities['deviceType'] = ENV['SL_DEVICE_TYPE'] if ENV['SL_DEVICE_TYPE']
277
286
  capabilities['deviceOrientation'] = ENV['ORIENTATION'] if ENV['ORIENTATION']
278
- Environ.set_device_type(ENV['SL_DEVICE'])
279
- Environ.set_platform(:mobile)
287
+ Environ.device_type = ENV['SL_DEVICE']
288
+ Environ.platform = :mobile
280
289
  end
281
290
 
282
291
  Capybara::Selenium::Driver.new(app, :browser => :remote, :url => endpoint, :desired_capabilities => capabilities)
283
292
  end
284
293
 
285
- Environ.set_browser(browser)
294
+ Environ.browser = browser
286
295
 
287
296
  Capybara.default_driver = :saucelabs
288
297
  Capybara.run_server = false
@@ -308,17 +317,17 @@ module TestCentricity
308
317
  capabilities['orientation'] = ENV['ORIENTATION'] if ENV['ORIENTATION']
309
318
  capabilities['platformName'] = ENV['TB_PLATFORM']
310
319
  capabilities['deviceName'] = ENV['TB_DEVICE']
311
- Environ.set_device_type(ENV['TB_DEVICE'])
312
- Environ.set_device(true)
313
- Environ.set_platform(:mobile)
320
+ Environ.device_type = ENV['TB_DEVICE']
321
+ Environ.device = true
322
+ Environ.platform = :mobile
314
323
  else
315
- Environ.set_platform(:desktop)
324
+ Environ.platform = :desktop
316
325
  end
317
326
 
318
327
  Capybara::Selenium::Driver.new(app, :browser => :remote, :url => endpoint, :desired_capabilities => capabilities)
319
328
  end
320
329
 
321
- Environ.set_browser(browser)
330
+ Environ.browser = browser
322
331
 
323
332
  Capybara.default_driver = :testingbot
324
333
  Capybara.run_server = false
File without changes
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
26
26
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
27
27
  spec.require_paths = ['lib']
28
+ spec.requirements << 'Capybara, Selenium-WebDriver'
28
29
 
29
30
  spec.add_development_dependency 'bundler', '~> 1.5'
30
31
  spec.add_development_dependency 'rake'
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: 1.0.16
4
+ version: 1.0.17
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: 2016-10-25 00:00:00.000000000 Z
11
+ date: 2016-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -182,6 +182,7 @@ files:
182
182
  - ".idea/misc.xml"
183
183
  - ".idea/modules.xml"
184
184
  - ".idea/vcs.xml"
185
+ - ".rubocop.yml"
185
186
  - ".yardopts"
186
187
  - Gemfile
187
188
  - LICENSE.txt
@@ -233,7 +234,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
234
  - - ">="
234
235
  - !ruby/object:Gem::Version
235
236
  version: '0'
236
- requirements: []
237
+ requirements:
238
+ - Capybara, Selenium-WebDriver
237
239
  rubyforge_project:
238
240
  rubygems_version: 2.6.5
239
241
  signing_key: