Skip to content

Commit 3cb91c8

Browse files
author
Dave Haeffner
committed
Removing the standalone server since local runs now work through the gem, updated the config yaml moving the local switch to the top portion of the config, and added some missing syntax that would have caused errors
1 parent b3f206a commit 3cb91c8

File tree

3 files changed

+31
-34
lines changed

3 files changed

+31
-34
lines changed
-31.8 MB
Binary file not shown.

lib/chemistrykit/shared_context.rb

+28-31
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,40 @@
11
require 'rspec/core/shared_context'
2-
require File.join(Dir.getwd, 'config', 'phone_home')
2+
require File.join(Dir.getwd, 'config', 'requires')
33

44
module ChemistryKit
55
module SharedContext
66
extend RSpec::Core::SharedContext
77

88
before(:each) do
9-
# if CHEMISTRY_CONFIG['webdriver']['local_server']
10-
# capabilities = Selenium::WebDriver.for(CHEMISTRY_CONFIG['webdriver']['browser'].to_sym)
11-
# else
9+
if CHEMISTRY_CONFIG['chemistrykit']['run_locally']
10+
@driver = Selenium::WebDriver.for(CHEMISTRY_CONFIG['webdriver']['browser'].to_sym)
11+
else
1212
capabilities = Selenium::WebDriver::Remote::Capabilities.send(CHEMISTRY_CONFIG['webdriver']['browser'])
13-
# end
14-
#
15-
# if CHEMISTRY_CONFIG['saucelabs']['ondemand']
16-
# MAGIC_KEYS = [
17-
# :caller,
18-
# :description,
19-
# :description_args,
20-
# :example_group,
21-
# :example_group_block,
22-
# :execution_result,
23-
# :file_path,
24-
# :full_description,
25-
# :line_number,
26-
# :location
27-
# ]
28-
# executor = "http://#{SAUCE_CONFIG['username']}:#{SAUCE_CONFIG['key']}@ondemand.saucelabs.com:80/wd/hub"
29-
# if CHEMISTRY_CONFIG['webdriver']['browser'] != 'chrome'
30-
# capabilities[:version] = CHEMISTRY_CONFIG['saucelabs']['version']
31-
# end
32-
# capabilities[:platform] = CHEMISTRY_CONFIG['saucelabs']['platform']
33-
# else
34-
executor = 'http://' + CHEMISTRY_CONFIG['webdriver']['server_host'] + ":" + CHEMISTRY_CONFIG['webdriver']['server_port'].to_s + '/wd/hub'
35-
# end
3613

37-
# @driver = ChemistryKit::PhoneHome::Driver.new(:url => executor, :desired_capabilities => capabilities)
38-
@driver = ChemistryKit::WebDriver::Driver.new(:url => executor, :desired_capabilities => capabilities)
39-
puts @driver.inspect
40-
puts @driver.object_id
14+
if CHEMISTRY_CONFIG['saucelabs']['ondemand']
15+
MAGIC_KEYS = [
16+
:caller,
17+
:description,
18+
:description_args,
19+
:example_group,
20+
:example_group_block,
21+
:execution_result,
22+
:file_path,
23+
:full_description,
24+
:line_number,
25+
:location
26+
]
27+
executor = "http://#{SAUCE_CONFIG['username']}:#{SAUCE_CONFIG['key']}@ondemand.saucelabs.com:80/wd/hub"
28+
if CHEMISTRY_CONFIG['webdriver']['browser'] != 'chrome'
29+
capabilities[:version] = CHEMISTRY_CONFIG['saucelabs']['version']
30+
end
31+
capabilities[:platform] = CHEMISTRY_CONFIG['saucelabs']['platform']
32+
else
33+
executor = 'http://' + CHEMISTRY_CONFIG['webdriver']['server_host'] + ":" + CHEMISTRY_CONFIG['webdriver']['server_port'].to_s + '/wd/hub'
34+
end
35+
36+
@driver = ChemistryKit::WebDriver::Driver.new(:url => executor, :desired_capabilities => capabilities)
37+
end
4138
end
4239

4340
after(:each) do

lib/templates/chemistrykit/config/chemistrykit.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
chemistrykit: {
33
project: YourProjectName,
4-
capture_output: false
4+
capture_output: false,
5+
run_locally: true
56
}
67

78
webdriver: {
89
browser: firefox,
910
server_host: localhost,
10-
server_port: 4444,
11-
local_server: true
11+
server_port: 4444
1212
}
1313

1414
saucelabs: {

0 commit comments

Comments
 (0)