public
Description: Simple integration between selenium and rails.
Clone URL: git://github.com/techbelly/selenium_rails.git
Start of vm launching and running functions
techbelly (author)
Thu Jul 10 09:05:20 -0700 2008
commit  f21ea13e397406adb8578ed460b24873169e8b4e
tree    e9a5c86affd8e64c96254980128b3d698abc8875
parent  0efb5daf312865fd548ddf966ef4628361a23e34
...
15
16
17
 
 
 
 
 
 
 
18
19
 
20
21
22
...
15
16
17
18
19
20
21
22
23
24
25
 
26
27
28
29
0
@@ -15,8 +15,15 @@ module SeleniumRails
0
       @@session.start
0
     end
0
   
0
+ def start_mediator
0
+ return @mediator.run_suite
0
+ rescue Exception => e
0
+ @@session.stop rescue nil
0
+ raise e
0
+ end
0
+
0
     def finished(elapsed_time)
0
- @@session.stop
0
+ @@session.stop rescue nil
0
       super(elapsed_time)
0
     end
0
   end
...
1
2
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
 
 
 
 
 
 
 
24
25
26
27
28
 
29
30
31
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
29
30
31
32
33
34
35
36
37
38
39
 
40
41
42
43
0
@@ -1,31 +1,43 @@
0
 module SeleniumRails
0
   module Session
0
    
0
+ module Infrastructure
0
+ def start
0
+ @infrastructure.each { |i| i.start }
0
+ end
0
+
0
+ def stop
0
+ @infrastructure.reverse.each { |i| i.stop }
0
+ end
0
+
0
+ def method_missing(method_name,*args)
0
+ if args.empty?
0
+ @session.send(method_name)
0
+ else
0
+ @session.send(method_name, *args)
0
+ end
0
+ end
0
+ end
0
+
0
    class LocalFirefox
0
+ include Infrastructure
0
       def initialize
0
         @session = Selenium::SeleniumDriver.new("localhost", 4444, "*firefox", "http://localhost:4001", 10000)
0
         @infrastructure = RailsApplication.default, SeleniumRC.new, @session
0
       end
0
-
0
- def start
0
- @infrastructure.each { |i| i.start }
0
- end
0
-
0
- def stop
0
- @infrastructure.reverse.each { |i| i.stop }
0
- end
0
-
0
- def method_missing(method_name,*args)
0
- if args.empty?
0
- @session.send(method_name)
0
- else
0
- @session.send(method_name, *args)
0
- end
0
+ end
0
+
0
+ class GridIE6
0
+ include Infrastructure
0
+ def initialize
0
+ local_ip = IPSocket.getaddress(Socket.gethostname)
0
+ @session = Selenium::SeleniumDriver.new("localhost", 8444, "*custom /home/theo/bin/ie6", "http://#{local_ip}:4001", 10000)
0
+ @infrastructure = RailsApplication.default, VirtualBox.new, @session
0
       end
0
    end
0
    
0
    def default
0
- LocalFirefox
0
+ GridIE6
0
    end
0
     
0
    extend(self)

Comments

    No one has commented yet.