testcentricity_web 1.0.13 → 1.0.14

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: cf89c5afd0ca60f69d268b00b52500ce994c38d8
4
- data.tar.gz: d0fba7f9377fc22a98b0f073b8f2c8c70d8d0168
3
+ metadata.gz: 27491e3ecff374590c34186d09a5699fcd0eed24
4
+ data.tar.gz: 032b2dba794fd386c335cbc3b446054fe8ffd680
5
5
  SHA512:
6
- metadata.gz: 08af8c2f845cb7e1025fd85409bb42b89e1ff4e2c5cf5e7cbfe7040b06ca77052dc32632cebb80f0fa02398c9ad13888f830998ca7a32236fe8b5cf690c0d7a4
7
- data.tar.gz: fe29e5bcd42a165764109474b95e154ad6255c4ba00791b12eb5cc778055c035483ef37aec22dfec12b93cdc9e8b45c4f4645d1268f5851413d9220026601c3d
6
+ metadata.gz: 389883aafd94e795e83c36846be8a2916e6938db633539f571254b4ec5ef54dec8bf30d8e41d6ddcc425c5a0930da7263e453dc7f29e833f2500480dc4d5970b
7
+ data.tar.gz: 59401a9f0c32cf77e394453707afb795678b5dbd2caa8613f556bffb48f68d0cb535f49905a87cf7ed70fa1f30eba1665ef4f39e3443c15aa026303f432aa1e2
data/README.md CHANGED
@@ -753,7 +753,9 @@ in your `cucumber.yml` file.
753
753
 
754
754
  Below is a list of Cucumber **Profiles** for supported locally and remotely hosted desktop and mobile web browsers (put these in in your
755
755
  `cucumber.yml` file). Before you can use the BrowserStack, CrossBrowserTesting, Sauce Labs, or TestingBot services, you will need to
756
- replace the placeholder text with your user account and authorization code for the cloud service(s) that you intend to connect with.
756
+ replace the *INSERT USER NAME HERE* and *INSERT PASSWORD HERE* placeholder text with your user account and authorization code for the cloud
757
+ service(s) that you intend to connect with.
758
+
757
759
 
758
760
  <% desktop = "--tags ~@wip --tags ~@failing --tags @desktop --require features BROWSER_SIZE=1600,1000" %>
759
761
  <% mobile = "--tags ~@wip --tags ~@failing --tags @mobile --require features" %>
@@ -223,16 +223,16 @@ module TestCentricity
223
223
  test_value = value.split('!', 2)
224
224
  parameter = test_value[1].split('.', 2)
225
225
  case parameter[0]
226
- when 'Address', 'Business', 'Code', 'Color', 'Commerce', 'Company', 'Crypto', 'File', 'Hacker', 'Hipster', 'Internet', 'Lorem', 'Name', 'Number', 'PhoneNumber'
227
- result = eval("Faker::#{parameter[0]}.#{parameter[1]}")
228
- when 'Date'
229
- result = eval("Chronic.parse('#{parameter[1]}')")
230
- when 'FormattedDate', 'FormatDate'
231
- date_time_params = parameter[1].split(" format! ", 2)
232
- date_time = eval("Chronic.parse('#{date_time_params[0].strip}')")
233
- result = date_time.to_s.format_date_time("#{date_time_params[1].strip}")
234
- else
235
- result = eval(test_value[1])
226
+ when 'Address', 'Bitcoin', 'Business', 'Code', 'Color', 'Commerce', 'Company', 'Crypto', 'File', 'Hacker', 'Hipster', 'Internet', 'Lorem', 'Name', 'Number', 'PhoneNumber'
227
+ result = eval("Faker::#{parameter[0]}.#{parameter[1]}")
228
+ when 'Date'
229
+ result = eval("Chronic.parse('#{parameter[1]}')")
230
+ when 'FormattedDate', 'FormatDate'
231
+ date_time_params = parameter[1].split(" format! ", 2)
232
+ date_time = eval("Chronic.parse('#{date_time_params[0].strip}')")
233
+ result = date_time.to_s.format_date_time("#{date_time_params[1].strip}")
234
+ else
235
+ result = eval(test_value[1])
236
236
  end
237
237
  result.to_s
238
238
  end
@@ -352,36 +352,36 @@ module TestCentricity
352
352
  end
353
353
 
354
354
  def find_object(visible = true)
355
- @alt_locator.nil? ? locator = @locator : locator = @alt_locator
355
+ @alt_locator.nil? ? obj_locator = @locator : obj_locator = @alt_locator
356
356
  tries ||= 6
357
- attributes = [:id, :ignore_parent_xpath, :ignore_parent_css, :type_xpath_css, :type_css_xpath, :xpath, :css]
357
+ attributes = [:id, 'ignore_parent_xpath', 'ignore_parent_css', 'xpath_css', 'css_xpath', :xpath, :css]
358
358
  type = attributes[tries]
359
359
  if @context == :section && !@parent.get_locator.nil?
360
360
  parent_locator = @parent.get_locator
361
361
  case type
362
362
  when :css
363
363
  parent_locator = parent_locator.gsub('|', ' ')
364
- obj = page.find(:css, parent_locator, :wait => 0.01).find(:css, locator, :wait => 0.01, :visible => visible)
364
+ obj = page.find(:css, parent_locator, :wait => 0.01).find(:css, obj_locator, :wait => 0.01, :visible => visible)
365
365
  when :xpath
366
366
  parent_locator = parent_locator.gsub('|', '')
367
- obj = page.find(:xpath, "#{parent_locator}#{locator}", :wait => 0.01, :visible => visible)
368
- when :type_css_xpath
367
+ obj = page.find(:xpath, "#{parent_locator}#{obj_locator}", :wait => 0.01, :visible => visible)
368
+ when 'css_xpath'
369
369
  type = :xpath
370
370
  parent_locator = parent_locator.gsub('|', ' ')
371
- obj = page.find(:css, parent_locator, :wait => 0.01).find(:xpath, locator, :wait => 0.01, :visible => visible)
372
- when :type_xpath_css
371
+ obj = page.find(:css, parent_locator, :wait => 0.01).find(:xpath, obj_locator, :wait => 0.01, :visible => visible)
372
+ when 'xpath_css'
373
373
  type = :css
374
374
  parent_locator = parent_locator.gsub('|', ' ')
375
- obj = page.find(:xpath, parent_locator, :wait => 0.01).find(:css, locator, :wait => 0.01, :visible => visible)
376
- when :ignore_parent_css
375
+ obj = page.find(:xpath, parent_locator, :wait => 0.01).find(:css, obj_locator, :wait => 0.01, :visible => visible)
376
+ when 'ignore_parent_css'
377
377
  type = :css
378
- obj = page.find(:css, locator, :wait => 0.01, :visible => visible)
379
- when :ignore_parent_xpath
378
+ obj = page.find(:css, obj_locator, :wait => 0.01, :visible => visible)
379
+ when 'ignore_parent_xpath'
380
380
  type = :xpath
381
- obj = page.find(:xpath, locator, :wait => 0.01, :visible => visible)
381
+ obj = page.find(:xpath, obj_locator, :wait => 0.01, :visible => visible)
382
382
  end
383
383
  else
384
- obj = page.find(type, locator, :wait => 0.01, :visible => visible)
384
+ obj = page.find(type, obj_locator, :wait => 0.01, :visible => visible)
385
385
  end
386
386
  [obj, type]
387
387
  rescue
@@ -1,3 +1,3 @@
1
1
  module TestCentricityWeb
2
- VERSION = '1.0.13'
2
+ VERSION = '1.0.14'
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require 'selenium-webdriver'
2
+ require 'os'
2
3
 
3
4
 
4
5
  module TestCentricity
@@ -35,7 +36,7 @@ module TestCentricity
35
36
  initialize_testingbot
36
37
  context = 'TestingBot cloud service'
37
38
  else
38
- if ENV["SELENIUM"] == 'remote'
39
+ if ENV['SELENIUM'] == 'remote'
39
40
  initialize_remote
40
41
  context = 'Selenium Grid2'
41
42
  else
@@ -56,6 +57,27 @@ module TestCentricity
56
57
  Capybara.app_host = url
57
58
  end
58
59
 
60
+ # Set the WebDriver path for Chrome, IE, or Edge browsers
61
+ def self.set_webdriver_path(project_path)
62
+ path_to_driver = nil
63
+ 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)
77
+ end
78
+ puts "The webdriver path is: #{path_to_driver}" unless path_to_driver.nil?
79
+ end
80
+
59
81
  private
60
82
 
61
83
  def self.initialize_appium
@@ -36,4 +36,5 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency 'faker', '1.6.6'
37
37
  spec.add_dependency 'chronic', '0.10.2'
38
38
  spec.add_dependency 'spreadsheet', '1.1.1'
39
+ spec.add_dependency 'os'
39
40
  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: 1.0.13
4
+ version: 1.0.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: 2016-10-21 00:00:00.000000000 Z
11
+ date: 2016-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -148,6 +148,20 @@ dependencies:
148
148
  - - '='
149
149
  - !ruby/object:Gem::Version
150
150
  version: 1.1.1
151
+ - !ruby/object:Gem::Dependency
152
+ name: os
153
+ requirement: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ type: :runtime
159
+ prerelease: false
160
+ version_requirements: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
151
165
  description: |2-
152
166
 
153
167
  TestCentricity™ Web core generic framework for desktop and mobile web site testing implements a Page Object Model DSL