testingbot 0.1.7 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -2
- data/LICENSE +1 -1
- data/README.md +137 -0
- data/bin/testingbot +4 -3
- data/lib/testingbot.rb +1 -5
- data/lib/testingbot/api.rb +91 -15
- data/lib/testingbot/version.rb +1 -1
- data/spec/integration/api_spec.rb +21 -15
- data/spec/spec_helper.rb +6 -3
- data/testingbot.gemspec +3 -3
- metadata +7 -52
- data/README.rdoc +0 -237
- data/examples/android.rb +0 -14
- data/examples/capybara.rb +0 -22
- data/examples/capybara_multiple_browsers.rb +0 -38
- data/examples/cucumber/README.rdoc +0 -15
- data/examples/cucumber/Rakefile +0 -20
- data/examples/cucumber/features/support/env.rb +0 -13
- data/examples/cucumber/features/youtube.feature +0 -10
- data/examples/cucumber/features/youtube_steps.rb +0 -15
- data/examples/test_rspec.rb +0 -17
- data/examples/test_rspec1.rb +0 -36
- data/examples/test_unit.rb +0 -30
- data/lib/testingbot/capybara.rb +0 -66
- data/lib/testingbot/config.rb +0 -125
- data/lib/testingbot/cucumber.rb +0 -35
- data/lib/testingbot/hooks.rb +0 -284
- data/lib/testingbot/jasmine.rb +0 -29
- data/lib/testingbot/jasmine/README.rdoc +0 -16
- data/lib/testingbot/jasmine/Rakefile +0 -35
- data/lib/testingbot/jasmine/public/javascripts/Player.js +0 -22
- data/lib/testingbot/jasmine/public/javascripts/Song.js +0 -7
- data/lib/testingbot/jasmine/runner.rb +0 -4
- data/lib/testingbot/jasmine/spec/javascripts/PlayerSpec.js +0 -58
- data/lib/testingbot/jasmine/spec/javascripts/helpers/SpecHelper.js +0 -9
- data/lib/testingbot/jasmine/spec/javascripts/support/jasmine.yml +0 -73
- data/lib/testingbot/jasmine/test/Rakefile +0 -9
- data/lib/testingbot/jasmine/test/public/javascripts/Player.js +0 -22
- data/lib/testingbot/jasmine/test/public/javascripts/Song.js +0 -7
- data/lib/testingbot/jasmine/test/spec/javascripts/PlayerSpec.js +0 -58
- data/lib/testingbot/jasmine/test/spec/javascripts/helpers/SpecHelper.js +0 -9
- data/lib/testingbot/jasmine/test/spec/javascripts/support/jasmine.yml +0 -73
- data/lib/testingbot/selenium.rb +0 -127
- data/lib/testingbot/tunnel.rb +0 -104
- data/spec/integration/selenium1_spec.rb +0 -53
- data/spec/integration/selenium2_spec.rb +0 -60
- data/spec/integration/tunnel_spec.rb +0 -84
- data/spec/unit/api_spec.rb +0 -17
- data/spec/unit/config_spec.rb +0 -73
- data/spec/unit/tunnel_spec.rb +0 -41
- data/vendor/Testingbot-Tunnel.jar +0 -0
data/spec/unit/config_spec.rb
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
require "rspec"
|
2
|
-
require 'selenium/webdriver'
|
3
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../lib/testingbot/config.rb')
|
4
|
-
|
5
|
-
describe TestingBot::Config do
|
6
|
-
describe '#[]' do
|
7
|
-
it "should return nil for options that don't exist" do
|
8
|
-
c = TestingBot::Config.new
|
9
|
-
c[:doesnotexist].should be_nil
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should return a config value when being set from the constructor" do
|
13
|
-
c = TestingBot::Config.new({ :client_secret => "secret!!" })
|
14
|
-
c[:client_secret].should == "secret!!"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe '#[]=' do
|
19
|
-
it "should successfully set a config value" do
|
20
|
-
c = TestingBot::Config.new
|
21
|
-
value = rand * 1000
|
22
|
-
c[:client_key] = value
|
23
|
-
c[:client_key].should == value
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
describe "read config file" do
|
28
|
-
it "should read values from the .testingbot config file" do
|
29
|
-
if File.exists?(File.expand_path("~/.testingbot"))
|
30
|
-
c = TestingBot::Config.new
|
31
|
-
client_key, client_secret = File.open(File.expand_path("~/.testingbot")) { |f| f.readline }.chomp.split(":")
|
32
|
-
c[:client_key].should == client_key
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should use the options I pass in the constructor, even if I have a config file" do
|
37
|
-
if File.exists?(File.expand_path("~/.testingbot"))
|
38
|
-
c = TestingBot::Config.new({ :client_key => "pickme" })
|
39
|
-
client_key, client_secret = File.open(File.expand_path("~/.testingbot")) { |f| f.readline }.chomp.split(":")
|
40
|
-
c[:client_key].should == "pickme"
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
describe "config values" do
|
46
|
-
it "should specify a default desired capability if the user did not specify any" do
|
47
|
-
c = TestingBot::Config.new
|
48
|
-
c.desired_capabilities.should_not be_empty
|
49
|
-
end
|
50
|
-
|
51
|
-
it "should be possible to use a Selenium::WebDriver::Remote::Capabilities object for the desired capabilities" do
|
52
|
-
c = TestingBot::Config.new
|
53
|
-
c[:desired_capabilities] = Selenium::WebDriver::Remote::Capabilities.firefox
|
54
|
-
c.desired_capabilities[:browserName].should eql("firefox")
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
describe "usage" do
|
59
|
-
it "should use the TestingBot.get_config as a singleton" do
|
60
|
-
c = TestingBot.get_config
|
61
|
-
c.should eql(TestingBot.get_config)
|
62
|
-
end
|
63
|
-
|
64
|
-
it "should be possible to reset the configuration" do
|
65
|
-
c = TestingBot.get_config
|
66
|
-
c.add_options({ :randomKey => "lol" })
|
67
|
-
|
68
|
-
TestingBot.reset_config!
|
69
|
-
c = TestingBot.get_config
|
70
|
-
c[:randomKey].should be_nil
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
data/spec/unit/tunnel_spec.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
require "rspec"
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../lib/testingbot/config.rb')
|
3
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../lib/testingbot/tunnel.rb')
|
4
|
-
|
5
|
-
describe TestingBot::Tunnel do
|
6
|
-
describe "load config" do
|
7
|
-
it "should load the configuration in the constructor" do
|
8
|
-
tunnel = TestingBot::Tunnel.new
|
9
|
-
tunnel.instance_variable_get("@config").should_not be_nil
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should should not overwrite the config with arguments supplied in the constructor" do
|
13
|
-
tunnel = TestingBot::Tunnel.new({ :client_key => "fake" })
|
14
|
-
tunnel.instance_variable_get("@config")[:client_key].should_not eql("fake")
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should allow for extra options to be specified, which will be passed to the jar's argument list" do
|
18
|
-
tunnel = TestingBot::Tunnel.new({ :options => ["-f readyfile.txt", "-F *.com"] })
|
19
|
-
tunnel.extra_options.should eql("-f readyfile.txt -F *.com")
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
describe "before starting the tunnel" do
|
24
|
-
it "should have 0 errors" do
|
25
|
-
tunnel = TestingBot::Tunnel.new
|
26
|
-
tunnel.errors.should be_empty
|
27
|
-
end
|
28
|
-
|
29
|
-
it "should not be connected" do
|
30
|
-
tunnel = TestingBot::Tunnel.new
|
31
|
-
tunnel.is_connected?.should == false
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
describe "before stopping the tunnel" do
|
36
|
-
it "should check if the tunnel has been started yet" do
|
37
|
-
tunnel = TestingBot::Tunnel.new
|
38
|
-
lambda { tunnel.stop }.should raise_error(RuntimeError, /^Can't stop tunnel/)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
Binary file
|