testingbot 0.1.7 → 0.2.0
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 +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/lib/testingbot/jasmine.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'jasmine'
|
2
|
-
require 'testingbot/tunnel'
|
3
|
-
|
4
|
-
module TestingBot
|
5
|
-
module Jasmine
|
6
|
-
|
7
|
-
class Driver < ::Jasmine::SeleniumDriver
|
8
|
-
attr_reader :http_address, :driver, :browser
|
9
|
-
|
10
|
-
def initialize(browser, http_address)
|
11
|
-
tunnel = TestingBot::Tunnel.new(TestingBot.get_config[:tunnel_options] || {})
|
12
|
-
tunnel.start
|
13
|
-
|
14
|
-
@browser = browser
|
15
|
-
@http_address = http_address
|
16
|
-
@driver = TestingBot::SeleniumWebdriver.new({ :browserName => browser, :name => "Jasmine Test" })
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
module Jasmine
|
23
|
-
class Config
|
24
|
-
def start
|
25
|
-
@client = TestingBot::Jasmine::Driver.new(browser, "#{jasmine_host}:3001/")
|
26
|
-
@client.connect
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
= TestingBot
|
2
|
-
|
3
|
-
Testingbot.com is a website where you can use our cloud based Selenium grid. Test your web applications in various environments/browsers/devices.
|
4
|
-
|
5
|
-
== How to run a Jasmine test on TestingBot
|
6
|
-
|
7
|
-
Make sure you have the Jasmine gem installed
|
8
|
-
|
9
|
-
$ gem install jasmine
|
10
|
-
|
11
|
-
Now run our example Rake task:
|
12
|
-
$ rake jasmine:testingbot
|
13
|
-
|
14
|
-
== More information
|
15
|
-
|
16
|
-
Get more information on http://testingbot.com
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'jasmine'
|
2
|
-
require 'rspec/core/rake_task'
|
3
|
-
require 'testingbot'
|
4
|
-
|
5
|
-
namespace :jasmine do
|
6
|
-
def run_jasmine_server
|
7
|
-
ENV['JASMINE_PORT'] = '3001'
|
8
|
-
Jasmine::Config.new.start_jasmine_server
|
9
|
-
end
|
10
|
-
|
11
|
-
desc "Execute Jasmine tests in a Chrome browser on testingbot"
|
12
|
-
task :testingbot do
|
13
|
-
run_jasmine_server
|
14
|
-
Rake::Task['jasmine:testingbot:chrome'].execute
|
15
|
-
end
|
16
|
-
|
17
|
-
namespace :testingbot do
|
18
|
-
desc "Execute Jasmine tests in Chrome and Firefox on TestingBot"
|
19
|
-
task :all do
|
20
|
-
run_jasmine_server
|
21
|
-
threads = []
|
22
|
-
[:chrome, :firefox].each do |browser|
|
23
|
-
t = Thread.new do
|
24
|
-
Rake::Task["jasmine:testingbot:#{browser}"].invoke
|
25
|
-
end
|
26
|
-
t.abort_on_exception = true
|
27
|
-
threads << t
|
28
|
-
end
|
29
|
-
|
30
|
-
threads.each do |t|
|
31
|
-
t.join
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
function Player() {
|
2
|
-
}
|
3
|
-
Player.prototype.play = function(song) {
|
4
|
-
this.currentlyPlayingSong = song;
|
5
|
-
this.isPlaying = true;
|
6
|
-
};
|
7
|
-
|
8
|
-
Player.prototype.pause = function() {
|
9
|
-
this.isPlaying = false;
|
10
|
-
};
|
11
|
-
|
12
|
-
Player.prototype.resume = function() {
|
13
|
-
if (this.isPlaying) {
|
14
|
-
throw new Error("song is already playing");
|
15
|
-
}
|
16
|
-
|
17
|
-
this.isPlaying = true;
|
18
|
-
};
|
19
|
-
|
20
|
-
Player.prototype.makeFavorite = function() {
|
21
|
-
this.currentlyPlayingSong.persistFavoriteStatus(true);
|
22
|
-
};
|
@@ -1,58 +0,0 @@
|
|
1
|
-
describe("Player", function() {
|
2
|
-
var player;
|
3
|
-
var song;
|
4
|
-
|
5
|
-
beforeEach(function() {
|
6
|
-
player = new Player();
|
7
|
-
song = new Song();
|
8
|
-
});
|
9
|
-
|
10
|
-
it("should be able to play a Song", function() {
|
11
|
-
player.play(song);
|
12
|
-
expect(player.currentlyPlayingSong).toEqual(song);
|
13
|
-
|
14
|
-
//demonstrates use of custom matcher
|
15
|
-
expect(player).toBePlaying(song);
|
16
|
-
});
|
17
|
-
|
18
|
-
describe("when song has been paused", function() {
|
19
|
-
beforeEach(function() {
|
20
|
-
player.play(song);
|
21
|
-
player.pause();
|
22
|
-
});
|
23
|
-
|
24
|
-
it("should indicate that the song is currently paused", function() {
|
25
|
-
expect(player.isPlaying).toBeFalsy();
|
26
|
-
|
27
|
-
// demonstrates use of 'not' with a custom matcher
|
28
|
-
expect(player).not.toBePlaying(song);
|
29
|
-
});
|
30
|
-
|
31
|
-
it("should be possible to resume", function() {
|
32
|
-
player.resume();
|
33
|
-
expect(player.isPlaying).toBeTruthy();
|
34
|
-
expect(player.currentlyPlayingSong).toEqual(song);
|
35
|
-
});
|
36
|
-
});
|
37
|
-
|
38
|
-
// demonstrates use of spies to intercept and test method calls
|
39
|
-
it("tells the current song if the user has made it a favorite", function() {
|
40
|
-
spyOn(song, 'persistFavoriteStatus');
|
41
|
-
|
42
|
-
player.play(song);
|
43
|
-
player.makeFavorite();
|
44
|
-
|
45
|
-
expect(song.persistFavoriteStatus).toHaveBeenCalledWith(true);
|
46
|
-
});
|
47
|
-
|
48
|
-
//demonstrates use of expected exceptions
|
49
|
-
describe("#resume", function() {
|
50
|
-
it("should throw an exception if song is already playing", function() {
|
51
|
-
player.play(song);
|
52
|
-
|
53
|
-
expect(function() {
|
54
|
-
player.resume();
|
55
|
-
}).toThrow("song is already playing");
|
56
|
-
});
|
57
|
-
});
|
58
|
-
});
|
@@ -1,73 +0,0 @@
|
|
1
|
-
# src_files
|
2
|
-
#
|
3
|
-
# Return an array of filepaths relative to src_dir to include before jasmine specs.
|
4
|
-
# Default: []
|
5
|
-
#
|
6
|
-
# EXAMPLE:
|
7
|
-
#
|
8
|
-
# src_files:
|
9
|
-
# - lib/source1.js
|
10
|
-
# - lib/source2.js
|
11
|
-
# - dist/**/*.js
|
12
|
-
#
|
13
|
-
src_files:
|
14
|
-
- public/javascripts/**/*.js
|
15
|
-
|
16
|
-
# stylesheets
|
17
|
-
#
|
18
|
-
# Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.
|
19
|
-
# Default: []
|
20
|
-
#
|
21
|
-
# EXAMPLE:
|
22
|
-
#
|
23
|
-
# stylesheets:
|
24
|
-
# - css/style.css
|
25
|
-
# - stylesheets/*.css
|
26
|
-
#
|
27
|
-
stylesheets:
|
28
|
-
|
29
|
-
# helpers
|
30
|
-
#
|
31
|
-
# Return an array of filepaths relative to spec_dir to include before jasmine specs.
|
32
|
-
# Default: ["helpers/**/*.js"]
|
33
|
-
#
|
34
|
-
# EXAMPLE:
|
35
|
-
#
|
36
|
-
# helpers:
|
37
|
-
# - helpers/**/*.js
|
38
|
-
#
|
39
|
-
helpers:
|
40
|
-
|
41
|
-
# spec_files
|
42
|
-
#
|
43
|
-
# Return an array of filepaths relative to spec_dir to include.
|
44
|
-
# Default: ["**/*[sS]pec.js"]
|
45
|
-
#
|
46
|
-
# EXAMPLE:
|
47
|
-
#
|
48
|
-
# spec_files:
|
49
|
-
# - **/*[sS]pec.js
|
50
|
-
#
|
51
|
-
spec_files:
|
52
|
-
|
53
|
-
# src_dir
|
54
|
-
#
|
55
|
-
# Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.
|
56
|
-
# Default: project root
|
57
|
-
#
|
58
|
-
# EXAMPLE:
|
59
|
-
#
|
60
|
-
# src_dir: public
|
61
|
-
#
|
62
|
-
src_dir:
|
63
|
-
|
64
|
-
# spec_dir
|
65
|
-
#
|
66
|
-
# Spec directory path. Your spec_files must be returned relative to this path.
|
67
|
-
# Default: spec/javascripts
|
68
|
-
#
|
69
|
-
# EXAMPLE:
|
70
|
-
#
|
71
|
-
# spec_dir: spec/javascripts
|
72
|
-
#
|
73
|
-
spec_dir:
|
@@ -1,22 +0,0 @@
|
|
1
|
-
function Player() {
|
2
|
-
}
|
3
|
-
Player.prototype.play = function(song) {
|
4
|
-
this.currentlyPlayingSong = song;
|
5
|
-
this.isPlaying = true;
|
6
|
-
};
|
7
|
-
|
8
|
-
Player.prototype.pause = function() {
|
9
|
-
this.isPlaying = false;
|
10
|
-
};
|
11
|
-
|
12
|
-
Player.prototype.resume = function() {
|
13
|
-
if (this.isPlaying) {
|
14
|
-
throw new Error("song is already playing");
|
15
|
-
}
|
16
|
-
|
17
|
-
this.isPlaying = true;
|
18
|
-
};
|
19
|
-
|
20
|
-
Player.prototype.makeFavorite = function() {
|
21
|
-
this.currentlyPlayingSong.persistFavoriteStatus(true);
|
22
|
-
};
|
@@ -1,58 +0,0 @@
|
|
1
|
-
describe("Player", function() {
|
2
|
-
var player;
|
3
|
-
var song;
|
4
|
-
|
5
|
-
beforeEach(function() {
|
6
|
-
player = new Player();
|
7
|
-
song = new Song();
|
8
|
-
});
|
9
|
-
|
10
|
-
it("should be able to play a Song", function() {
|
11
|
-
player.play(song);
|
12
|
-
expect(player.currentlyPlayingSong).toEqual(song);
|
13
|
-
|
14
|
-
//demonstrates use of custom matcher
|
15
|
-
expect(player).toBePlaying(song);
|
16
|
-
});
|
17
|
-
|
18
|
-
describe("when song has been paused", function() {
|
19
|
-
beforeEach(function() {
|
20
|
-
player.play(song);
|
21
|
-
player.pause();
|
22
|
-
});
|
23
|
-
|
24
|
-
it("should indicate that the song is currently paused", function() {
|
25
|
-
expect(player.isPlaying).toBeFalsy();
|
26
|
-
|
27
|
-
// demonstrates use of 'not' with a custom matcher
|
28
|
-
expect(player).not.toBePlaying(song);
|
29
|
-
});
|
30
|
-
|
31
|
-
it("should be possible to resume", function() {
|
32
|
-
player.resume();
|
33
|
-
expect(player.isPlaying).toBeTruthy();
|
34
|
-
expect(player.currentlyPlayingSong).toEqual(song);
|
35
|
-
});
|
36
|
-
});
|
37
|
-
|
38
|
-
// demonstrates use of spies to intercept and test method calls
|
39
|
-
it("tells the current song if the user has made it a favorite", function() {
|
40
|
-
spyOn(song, 'persistFavoriteStatus');
|
41
|
-
|
42
|
-
player.play(song);
|
43
|
-
player.makeFavorite();
|
44
|
-
|
45
|
-
expect(song.persistFavoriteStatus).toHaveBeenCalledWith(true);
|
46
|
-
});
|
47
|
-
|
48
|
-
//demonstrates use of expected exceptions
|
49
|
-
describe("#resume", function() {
|
50
|
-
it("should throw an exception if song is already playing", function() {
|
51
|
-
player.play(song);
|
52
|
-
|
53
|
-
expect(function() {
|
54
|
-
player.resume();
|
55
|
-
}).toThrow("song is already playing");
|
56
|
-
});
|
57
|
-
});
|
58
|
-
});
|
@@ -1,73 +0,0 @@
|
|
1
|
-
# src_files
|
2
|
-
#
|
3
|
-
# Return an array of filepaths relative to src_dir to include before jasmine specs.
|
4
|
-
# Default: []
|
5
|
-
#
|
6
|
-
# EXAMPLE:
|
7
|
-
#
|
8
|
-
# src_files:
|
9
|
-
# - lib/source1.js
|
10
|
-
# - lib/source2.js
|
11
|
-
# - dist/**/*.js
|
12
|
-
#
|
13
|
-
src_files:
|
14
|
-
- public/javascripts/**/*.js
|
15
|
-
|
16
|
-
# stylesheets
|
17
|
-
#
|
18
|
-
# Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.
|
19
|
-
# Default: []
|
20
|
-
#
|
21
|
-
# EXAMPLE:
|
22
|
-
#
|
23
|
-
# stylesheets:
|
24
|
-
# - css/style.css
|
25
|
-
# - stylesheets/*.css
|
26
|
-
#
|
27
|
-
stylesheets:
|
28
|
-
|
29
|
-
# helpers
|
30
|
-
#
|
31
|
-
# Return an array of filepaths relative to spec_dir to include before jasmine specs.
|
32
|
-
# Default: ["helpers/**/*.js"]
|
33
|
-
#
|
34
|
-
# EXAMPLE:
|
35
|
-
#
|
36
|
-
# helpers:
|
37
|
-
# - helpers/**/*.js
|
38
|
-
#
|
39
|
-
helpers:
|
40
|
-
|
41
|
-
# spec_files
|
42
|
-
#
|
43
|
-
# Return an array of filepaths relative to spec_dir to include.
|
44
|
-
# Default: ["**/*[sS]pec.js"]
|
45
|
-
#
|
46
|
-
# EXAMPLE:
|
47
|
-
#
|
48
|
-
# spec_files:
|
49
|
-
# - **/*[sS]pec.js
|
50
|
-
#
|
51
|
-
spec_files:
|
52
|
-
|
53
|
-
# src_dir
|
54
|
-
#
|
55
|
-
# Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.
|
56
|
-
# Default: project root
|
57
|
-
#
|
58
|
-
# EXAMPLE:
|
59
|
-
#
|
60
|
-
# src_dir: public
|
61
|
-
#
|
62
|
-
src_dir:
|
63
|
-
|
64
|
-
# spec_dir
|
65
|
-
#
|
66
|
-
# Spec directory path. Your spec_files must be returned relative to this path.
|
67
|
-
# Default: spec/javascripts
|
68
|
-
#
|
69
|
-
# EXAMPLE:
|
70
|
-
#
|
71
|
-
# spec_dir: spec/javascripts
|
72
|
-
#
|
73
|
-
spec_dir:
|