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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -2
  3. data/LICENSE +1 -1
  4. data/README.md +137 -0
  5. data/bin/testingbot +4 -3
  6. data/lib/testingbot.rb +1 -5
  7. data/lib/testingbot/api.rb +91 -15
  8. data/lib/testingbot/version.rb +1 -1
  9. data/spec/integration/api_spec.rb +21 -15
  10. data/spec/spec_helper.rb +6 -3
  11. data/testingbot.gemspec +3 -3
  12. metadata +7 -52
  13. data/README.rdoc +0 -237
  14. data/examples/android.rb +0 -14
  15. data/examples/capybara.rb +0 -22
  16. data/examples/capybara_multiple_browsers.rb +0 -38
  17. data/examples/cucumber/README.rdoc +0 -15
  18. data/examples/cucumber/Rakefile +0 -20
  19. data/examples/cucumber/features/support/env.rb +0 -13
  20. data/examples/cucumber/features/youtube.feature +0 -10
  21. data/examples/cucumber/features/youtube_steps.rb +0 -15
  22. data/examples/test_rspec.rb +0 -17
  23. data/examples/test_rspec1.rb +0 -36
  24. data/examples/test_unit.rb +0 -30
  25. data/lib/testingbot/capybara.rb +0 -66
  26. data/lib/testingbot/config.rb +0 -125
  27. data/lib/testingbot/cucumber.rb +0 -35
  28. data/lib/testingbot/hooks.rb +0 -284
  29. data/lib/testingbot/jasmine.rb +0 -29
  30. data/lib/testingbot/jasmine/README.rdoc +0 -16
  31. data/lib/testingbot/jasmine/Rakefile +0 -35
  32. data/lib/testingbot/jasmine/public/javascripts/Player.js +0 -22
  33. data/lib/testingbot/jasmine/public/javascripts/Song.js +0 -7
  34. data/lib/testingbot/jasmine/runner.rb +0 -4
  35. data/lib/testingbot/jasmine/spec/javascripts/PlayerSpec.js +0 -58
  36. data/lib/testingbot/jasmine/spec/javascripts/helpers/SpecHelper.js +0 -9
  37. data/lib/testingbot/jasmine/spec/javascripts/support/jasmine.yml +0 -73
  38. data/lib/testingbot/jasmine/test/Rakefile +0 -9
  39. data/lib/testingbot/jasmine/test/public/javascripts/Player.js +0 -22
  40. data/lib/testingbot/jasmine/test/public/javascripts/Song.js +0 -7
  41. data/lib/testingbot/jasmine/test/spec/javascripts/PlayerSpec.js +0 -58
  42. data/lib/testingbot/jasmine/test/spec/javascripts/helpers/SpecHelper.js +0 -9
  43. data/lib/testingbot/jasmine/test/spec/javascripts/support/jasmine.yml +0 -73
  44. data/lib/testingbot/selenium.rb +0 -127
  45. data/lib/testingbot/tunnel.rb +0 -104
  46. data/spec/integration/selenium1_spec.rb +0 -53
  47. data/spec/integration/selenium2_spec.rb +0 -60
  48. data/spec/integration/tunnel_spec.rb +0 -84
  49. data/spec/unit/api_spec.rb +0 -17
  50. data/spec/unit/config_spec.rb +0 -73
  51. data/spec/unit/tunnel_spec.rb +0 -41
  52. data/vendor/Testingbot-Tunnel.jar +0 -0
@@ -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,7 +0,0 @@
1
- function Song() {
2
- }
3
-
4
- Song.prototype.persistFavoriteStatus = function(value) {
5
- // something complicated
6
- throw new Error("not yet implemented");
7
- };
@@ -1,4 +0,0 @@
1
- require 'testingbot'
2
- require 'testingbot/jasmine'
3
- ENV['JASMINE_PORT'] = '3001'
4
- require 'jasmine/runner'
@@ -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,9 +0,0 @@
1
- beforeEach(function() {
2
- this.addMatchers({
3
- toBePlaying: function(expectedSong) {
4
- var player = this.actual;
5
- return player.currentlyPlayingSong === expectedSong &&
6
- player.isPlaying;
7
- }
8
- });
9
- });
@@ -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,9 +0,0 @@
1
-
2
- begin
3
- require 'jasmine'
4
- load 'jasmine/tasks/jasmine.rake'
5
- rescue LoadError
6
- task :jasmine do
7
- abort "Jasmine is not available. In order to run jasmine, you must: (sudo) gem install jasmine"
8
- end
9
- 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,7 +0,0 @@
1
- function Song() {
2
- }
3
-
4
- Song.prototype.persistFavoriteStatus = function(value) {
5
- // something complicated
6
- throw new Error("not yet implemented");
7
- };
@@ -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,9 +0,0 @@
1
- beforeEach(function() {
2
- this.addMatchers({
3
- toBePlaying: function(expectedSong) {
4
- var player = this.actual;
5
- return player.currentlyPlayingSong === expectedSong &&
6
- player.isPlaying;
7
- }
8
- });
9
- });
@@ -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: