gondola 1.1.7 → 1.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -24,6 +24,19 @@ for more details.
24
24
  Gondola offers a simplistic command line application for quickly debugging tests written in the Selenium IDE. Gondola also offers a short and sweet API for
25
25
  integrating Gondola's features into any other application.
26
26
 
27
+ NOTE: Make sure that you configure your Sauce Labs username and access key by doing one of two things:
28
+
29
+ * Issue a command to the Sauce Labs gem:
30
+
31
+ $ sauce configure [username] [access-key]
32
+
33
+ * or create an ondemand.yml file in the directory structure of your tests:
34
+
35
+ :username: [username]
36
+ :access_key: [access-key]
37
+
38
+ before using Gondola in any capacity.
39
+
27
40
  ### Getting started
28
41
 
29
42
  $ gondola help
data/gondola.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gondola}
8
- s.version = "1.1.7"
8
+ s.version = "1.1.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matthew Perry"]
12
- s.date = %q{2011-03-16}
12
+ s.date = %q{2011-03-21}
13
13
  s.default_executable = %q{gondola}
14
14
  s.description = %q{
15
15
  Gondola is Ruby command line utility and as well as a library which helps
@@ -38,7 +38,6 @@ Gem::Specification.new do |s|
38
38
  "lib/gondola.rb",
39
39
  "lib/gondola/converter.rb",
40
40
  "lib/gondola/html_converter.rb",
41
- "lib/gondola/legacy_converter.rb",
42
41
  "lib/gondola/tester.rb",
43
42
  "lib/gondola/testrunner.rb",
44
43
  "lib/gondola/version.rb",
@@ -48,7 +47,7 @@ Gem::Specification.new do |s|
48
47
  s.homepage = %q{http://github.com/perrym5/gondola}
49
48
  s.licenses = ["MIT"]
50
49
  s.require_paths = ["lib"]
51
- s.rubygems_version = %q{1.6.1}
50
+ s.rubygems_version = %q{1.6.0}
52
51
  s.summary = %q{Ruby command line utility and library for integrating the Selenium IDE more tightly with Sauce Labs' Ondemand services}
53
52
  s.test_files = [
54
53
  "test/helper.rb",
@@ -4,20 +4,22 @@
4
4
 
5
5
  module Gondola
6
6
  class Converter
7
+ attr_writer :name
8
+ attr_reader :file
9
+
7
10
  # Constructor that opens a file
8
11
  def initialize(filename, sel="@sel")
9
12
  File.open(filename, "r") do |f|
10
13
  @body = f.read
11
14
  end
12
15
  @s_obj = sel
16
+ @file = filename
13
17
  ruby()
14
18
  end
15
19
 
16
- # Function: name
17
- # Returns the name of this test case
18
20
  def name
19
21
  unless @name
20
- @name = "Abstract Converter"
22
+ @name = @file
21
23
  end
22
24
  @name
23
25
  end
@@ -27,7 +29,7 @@ module Gondola
27
29
  # and returns valid selenium ruby code
28
30
  def ruby
29
31
  unless @ruby
30
- @ruby = "puts 'This is an abstract converter, do not use this.'"
32
+ @ruby = @body.gsub(/.*/, "\\&\ncmd_inc\n")
31
33
  end
32
34
  @ruby
33
35
  end
@@ -1,11 +1,9 @@
1
1
  # Gondola - html_converter.rb:
2
2
  # Class definition for turning Selenium HTML into
3
3
  # webdriver ruby code
4
- require 'rubygems'
5
- require 'gondola'
6
4
 
7
5
  module Gondola
8
- class HtmlConverter < Converter
6
+ class HtmlConverter < Gondola::Converter
9
7
  # Function: name
10
8
  # Returns the name of this test case
11
9
  def name
@@ -92,7 +90,7 @@ module Gondola
92
90
  var = args[1]
93
91
  extra = "(#{args[0]})"
94
92
  end
95
- retval = "#{tester}_eq #{var}, #{@s_obj}.get_#{underscore(string)}" + extra
93
+ retval = "#{tester}_equal #{var}, #{@s_obj}.get_#{underscore(string)}" + extra
96
94
  end
97
95
 
98
96
  # All commands return arrays that need to be joined
@@ -42,13 +42,13 @@ module Gondola
42
42
  end
43
43
  end
44
44
 
45
- def assert_eq(eq, expr)
45
+ def assert_equal(eq, expr)
46
46
  unless verify(eq, expr)
47
47
  raise "Assertion Failed"
48
48
  end
49
49
  end
50
50
 
51
- def assert_not_eq(eq, expr)
51
+ def assert_not_equal(eq, expr)
52
52
  unless verifyNot(eq, expr)
53
53
  raise "Assertion Failed"
54
54
  end
@@ -70,7 +70,7 @@ module Gondola
70
70
  return true
71
71
  end
72
72
 
73
- def verify_eq(eq, expr)
73
+ def verify_equal(eq, expr)
74
74
  unless eq == expr
75
75
  @stderr.puts "Command #{@cmd_num} returned '#{expr}', expecting '#{eq}'"
76
76
  return false
@@ -78,7 +78,7 @@ module Gondola
78
78
  return true
79
79
  end
80
80
 
81
- def verify_not_eq(eq, expr)
81
+ def verify_not_equal(eq, expr)
82
82
  if eq == expr
83
83
  @stderr.puts "Command #{@cmd_num} returned '#{expr}', expecting '#{eq}'"
84
84
  return false
@@ -2,9 +2,6 @@
2
2
  # A wrapper for all the tasks required for launching a run
3
3
  # of a test suite or test case on several browsers
4
4
 
5
- require 'rubygems'
6
- require 'gondola'
7
-
8
5
  module Gondola
9
6
  class TestRunner
10
7
  attr_reader :tests
@@ -66,7 +63,7 @@ module Gondola
66
63
  if File.extname(file) == '.html'
67
64
  converter = Gondola::HtmlConverter.new(file)
68
65
  elsif File.extname(file) == '.rb'
69
- converter = Gondola::LegacyConverter.new(file)
66
+ converter = Gondola::Converter.new(file)
70
67
  end
71
68
  # Load file config data
72
69
  conf = config_from_file(file)
@@ -1,3 +1,3 @@
1
1
  module Gondola
2
- VERSION = "1.1.7"
2
+ VERSION = "1.1.8"
3
3
  end
data/lib/gondola.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'gondola/converter'
3
3
  require 'gondola/html_converter'
4
- require 'gondola/legacy_converter'
5
4
  require 'gondola/tester'
6
5
  require 'gondola/testrunner'
7
6
  require 'gondola/version'
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: gondola
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.7
5
+ version: 1.1.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Matthew Perry
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-16 00:00:00 -04:00
13
+ date: 2011-03-21 00:00:00 -04:00
14
14
  default_executable: gondola
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -92,7 +92,6 @@ files:
92
92
  - lib/gondola.rb
93
93
  - lib/gondola/converter.rb
94
94
  - lib/gondola/html_converter.rb
95
- - lib/gondola/legacy_converter.rb
96
95
  - lib/gondola/tester.rb
97
96
  - lib/gondola/testrunner.rb
98
97
  - lib/gondola/version.rb
@@ -112,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
111
  requirements:
113
112
  - - ">="
114
113
  - !ruby/object:Gem::Version
115
- hash: 1003150642294150752
114
+ hash: -420131987
116
115
  segments:
117
116
  - 0
118
117
  version: "0"
@@ -125,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
124
  requirements: []
126
125
 
127
126
  rubyforge_project:
128
- rubygems_version: 1.6.1
127
+ rubygems_version: 1.6.0
129
128
  signing_key:
130
129
  specification_version: 3
131
130
  summary: Ruby command line utility and library for integrating the Selenium IDE more tightly with Sauce Labs' Ondemand services
@@ -1,41 +0,0 @@
1
- # Gondola - legacy_converter.rb
2
- # Class definition for turning old selenium-test
3
- # files into new ruby code for gondola
4
- require 'rubygems'
5
- require 'gondola'
6
-
7
- module Gondola
8
- class LegacyConverter < Converter
9
- # Function: name
10
- # Returns the name of this test case
11
- def name
12
- unless @name
13
- @name = @body.match(/class(.*?)</m)[1].strip
14
- end
15
- @name
16
- end
17
-
18
- # Function: ruby
19
- # This function parses the given legacy
20
- # test case file and parses it into the
21
- # new streamlined form
22
- def ruby
23
- unless @ruby
24
- @ruby = ""
25
-
26
- # Only search through relevent portions
27
- cmd_body = @body.match(/def test_case.*end/m)
28
- # Define a pattern for commands
29
- cmd_rxp = Regexp.new(/^.*?@selenium.*?$/)
30
-
31
- # Loop over all lines
32
- cmd_body[0].scan(cmd_rxp) do |cmd|
33
- @ruby << cmd.strip.sub(/@selenium/, "@sel")
34
- @ruby << "\ncmd_inc\n"
35
- end
36
- end
37
- @ruby
38
- end
39
- end
40
- end
41
-