File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ var http = require ( 'http' ) ;
2
+ var express = require ( 'express' ) ;
3
+ var path = require ( 'path' ) ;
4
+ var app = express ( ) ;
5
+ var exec = require ( 'child_process' ) . exec ;
6
+
7
+ function run_my_first_test_in_firefox ( ) {
8
+ exec ( "nosetests my_first_test.py --with-selenium" ) ;
9
+ }
10
+
11
+ function run_my_first_test_in_chrome ( ) {
12
+ exec ( "nosetests my_first_test.py --with-selenium --browser=chrome" ) ;
13
+ }
14
+
15
+ app . get ( '/' , function ( req , res ) {
16
+ res . sendFile ( path . join ( __dirname + '/index.html' ) ) ;
17
+ } )
18
+
19
+ app . get ( '/run_my_first_test_in_firefox' , function ( req , res ) {
20
+ res . sendFile ( path . join ( __dirname + '/index.html' ) ) ;
21
+ res . redirect ( '/' ) ;
22
+ run_my_first_test_in_firefox ( )
23
+ } )
24
+
25
+ app . get ( '/run_my_first_test_in_chrome' , function ( req , res ) {
26
+ res . sendFile ( path . join ( __dirname + '/index.html' ) ) ;
27
+ res . redirect ( '/' ) ;
28
+ run_my_first_test_in_chrome ( )
29
+ } )
30
+
31
+ app . listen ( 3000 , "127.0.0.1" , function ( ) {
32
+ console . log ( 'Server running at http://127.0.0.1:3000/' ) ;
33
+ } ) ;
34
+
You can’t perform that action at this time.
0 commit comments