gondola 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/gondola +2 -0
- data/gondola.gemspec +3 -3
- data/lib/gondola/converter.rb +1 -3
- data/lib/gondola/html_converter.rb +2 -3
- data/lib/gondola/tester.rb +8 -5
- data/lib/gondola/version.rb +1 -1
- data/test/test_converter.rb +2 -40
- metadata +4 -4
data/bin/gondola
CHANGED
@@ -49,6 +49,8 @@ class RunCommand < CmdParse::Command
|
|
49
49
|
result[:browser].each_value { |v| bs = bs + "#{v} " }
|
50
50
|
if result[:status] == :in_progress
|
51
51
|
puts "#{result[:id]}: Started test \"#{result[:name]}\" with #{bs}"
|
52
|
+
elsif result[:status] == :not_started
|
53
|
+
puts "#{result[:id]}: \"#{result[:name]}\" failed to start"
|
52
54
|
else
|
53
55
|
num = result[:errors].size
|
54
56
|
puts "#{result[:id]}: \"#{result[:name]}\" with #{bs}has completed with #{num} errors"
|
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.2.
|
8
|
+
s.version = "1.2.3"
|
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-
|
12
|
+
s.date = %q{2011-03-28}
|
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
|
@@ -55,7 +55,7 @@ Gem::Specification.new do |s|
|
|
55
55
|
s.homepage = %q{http://github.com/perrym5/gondola}
|
56
56
|
s.licenses = ["MIT"]
|
57
57
|
s.require_paths = ["lib"]
|
58
|
-
s.rubygems_version = %q{1.6.
|
58
|
+
s.rubygems_version = %q{1.6.0}
|
59
59
|
s.summary = %q{Ruby command line utility and library for integrating the Selenium IDE more tightly with Sauce Labs' Ondemand services}
|
60
60
|
s.test_files = [
|
61
61
|
"test/helper.rb",
|
data/lib/gondola/converter.rb
CHANGED
@@ -51,8 +51,7 @@ module Gondola
|
|
51
51
|
selenese = selenese + ")"
|
52
52
|
ruby = html_to_ruby(cmd[0], args)
|
53
53
|
@commands.push({ :selenese => selenese, :ruby => ruby })
|
54
|
-
@ruby << ruby
|
55
|
-
@ruby << "\ncmd_inc\n"
|
54
|
+
@ruby << ruby + "\n"
|
56
55
|
end
|
57
56
|
end
|
58
57
|
end
|
@@ -131,7 +130,7 @@ module Gondola
|
|
131
130
|
# A command with a postfix of AndWait simply adds
|
132
131
|
# a second command which waits a certain time
|
133
132
|
firstPart = html_to_ruby($1, args)
|
134
|
-
secondPart = "
|
133
|
+
secondPart = "; #{@s_obj}.wait_for_page_to_load \"30000\""
|
135
134
|
return firstPart + secondPart
|
136
135
|
|
137
136
|
# store command
|
data/lib/gondola/tester.rb
CHANGED
@@ -8,7 +8,7 @@ module Gondola
|
|
8
8
|
end
|
9
9
|
|
10
10
|
class Tester
|
11
|
-
attr_reader :
|
11
|
+
attr_reader :errors, :job_id, :status
|
12
12
|
|
13
13
|
def initialize(req, converter)
|
14
14
|
@sel = Gondola::Selenium.new req
|
@@ -24,6 +24,7 @@ module Gondola
|
|
24
24
|
@job_id = @sel.session_id
|
25
25
|
@status = :in_progress
|
26
26
|
rescue ::Selenium::Client::CommandError => e
|
27
|
+
@status = :not_started
|
27
28
|
add_error e.message
|
28
29
|
finish
|
29
30
|
end
|
@@ -60,16 +61,18 @@ module Gondola
|
|
60
61
|
end
|
61
62
|
end
|
62
63
|
|
63
|
-
def
|
64
|
-
|
64
|
+
def get_eval_cmd_num
|
65
|
+
ev = caller.keep_if { |c| c =~ /\(eval\)/ }[0]
|
66
|
+
ev.match(/:(\d+)/)[1].to_i - 1
|
65
67
|
end
|
66
68
|
|
67
69
|
# Add the current command to the error list
|
68
70
|
# with the given description
|
69
71
|
def add_error(desc)
|
72
|
+
cmd_num = get_eval_cmd_num
|
70
73
|
@errors.push({
|
71
|
-
:cmd_num =>
|
72
|
-
:command => @converter.commands[
|
74
|
+
:cmd_num => cmd_num,
|
75
|
+
:command => @converter.commands[cmd_num],
|
73
76
|
:error => desc
|
74
77
|
})
|
75
78
|
end
|
data/lib/gondola/version.rb
CHANGED
data/test/test_converter.rb
CHANGED
@@ -8,43 +8,24 @@ class TestConverter < Test::Unit::TestCase
|
|
8
8
|
|
9
9
|
should "properly convert a ruby file to a gondola ruby file" do
|
10
10
|
expected = %q{ @sel.open "/"
|
11
|
-
cmd_inc
|
12
11
|
@sel.wait_for_page_to_load "30000"
|
13
|
-
cmd_inc
|
14
12
|
@sel.type "q", "agora games"
|
15
|
-
cmd_inc
|
16
13
|
@sel.click "btnG"
|
17
|
-
cmd_inc
|
18
14
|
@sel.click "link=Careers"
|
19
|
-
cmd_inc
|
20
15
|
@sel.wait_for_page_to_load "30000"
|
21
|
-
cmd_inc
|
22
16
|
verify_equal "Agora Games", @sel.get_title
|
23
|
-
cmd_inc
|
24
17
|
verify @sel.is_text_present("At Agora")
|
25
|
-
cmd_inc
|
26
18
|
assert @sel.is_text_present("Platform Engineer")
|
27
|
-
cmd_inc
|
28
19
|
@sel.click "link=Application Engineer"
|
29
|
-
cmd_inc
|
30
20
|
assert @sel.is_text_present("Application Engineer")
|
31
|
-
cmd_inc
|
32
21
|
@sel.click "link=Producer"
|
33
|
-
cmd_inc
|
34
22
|
assert @sel.is_text_present("Producer")
|
35
|
-
cmd_inc
|
36
23
|
@sel.click "link=work at Agora."
|
37
|
-
cmd_inc
|
38
24
|
@sel.wait_for_page_to_load "30000"
|
39
|
-
cmd_inc
|
40
25
|
@sel.click "link=Fun at Agora"
|
41
|
-
cmd_inc
|
42
26
|
@sel.click "link=Hack-a-thon"
|
43
|
-
cmd_inc
|
44
27
|
@sel.click "link=Our Town"
|
45
|
-
cmd_inc
|
46
28
|
@sel.click "link=Communication at Agora"
|
47
|
-
cmd_inc
|
48
29
|
}.lines.map { |l| l.strip! }.join("\n")
|
49
30
|
assert_equal expected, @converter.ruby
|
50
31
|
assert_equal 19, @converter.commands.size
|
@@ -62,41 +43,22 @@ class TestConverter < Test::Unit::TestCase
|
|
62
43
|
|
63
44
|
should "properly convert a selenese HTML file to a gondola ruby file" do
|
64
45
|
expected = %q{ @sel.open "/"
|
65
|
-
cmd_inc
|
66
46
|
@sel.wait_for_page_to_load "30000"
|
67
|
-
cmd_inc
|
68
47
|
@sel.type "q", "agora games"
|
69
|
-
cmd_inc
|
70
48
|
@sel.click "btnG"
|
71
|
-
|
72
|
-
@sel.click "link=Careers"
|
73
|
-
@sel.wait_for_page_to_load "30000"
|
74
|
-
cmd_inc
|
49
|
+
@sel.click "link=Careers"; @sel.wait_for_page_to_load "30000"
|
75
50
|
verify_equal "Agora Games", @sel.get_title
|
76
|
-
cmd_inc
|
77
51
|
verify @sel.is_text_present("At Agora")
|
78
|
-
cmd_inc
|
79
52
|
assert @sel.is_text_present("Platform Engineer")
|
80
|
-
cmd_inc
|
81
53
|
@sel.click "link=Application Engineer"
|
82
|
-
cmd_inc
|
83
54
|
assert @sel.is_text_present("Application Engineer")
|
84
|
-
cmd_inc
|
85
55
|
@sel.click "link=Producer"
|
86
|
-
cmd_inc
|
87
56
|
assert @sel.is_text_present("Producer")
|
88
|
-
|
89
|
-
@sel.click "link=work at Agora."
|
90
|
-
@sel.wait_for_page_to_load "30000"
|
91
|
-
cmd_inc
|
57
|
+
@sel.click "link=work at Agora."; @sel.wait_for_page_to_load "30000"
|
92
58
|
@sel.click "link=Fun at Agora"
|
93
|
-
cmd_inc
|
94
59
|
@sel.click "link=Hack-a-thon"
|
95
|
-
cmd_inc
|
96
60
|
@sel.click "link=Our Town"
|
97
|
-
cmd_inc
|
98
61
|
@sel.click "link=Communication at Agora"
|
99
|
-
cmd_inc
|
100
62
|
}.lines.map { |l| l.strip! }.join("\n")
|
101
63
|
assert_equal expected, @converter.ruby
|
102
64
|
assert_equal 17, @converter.commands.size
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: gondola
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.2.
|
5
|
+
version: 1.2.3
|
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-
|
13
|
+
date: 2011-03-28 00:00:00 -04:00
|
14
14
|
default_executable: gondola
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -141,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
141
141
|
requirements:
|
142
142
|
- - ">="
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
hash:
|
144
|
+
hash: 299527533
|
145
145
|
segments:
|
146
146
|
- 0
|
147
147
|
version: "0"
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
requirements: []
|
155
155
|
|
156
156
|
rubyforge_project:
|
157
|
-
rubygems_version: 1.6.
|
157
|
+
rubygems_version: 1.6.0
|
158
158
|
signing_key:
|
159
159
|
specification_version: 3
|
160
160
|
summary: Ruby command line utility and library for integrating the Selenium IDE more tightly with Sauce Labs' Ondemand services
|