4
4
(Use Python 3 - There are GUI issues when using Python 2)
5
5
"""
6
6
7
- import os
7
+ import subprocess
8
8
import sys
9
9
10
10
if sys .version_info [0 ] >= 3 :
@@ -21,13 +21,13 @@ def __init__(self, master):
21
21
self .title = Label (frame , text = "" , fg = "black" ).pack ()
22
22
self .title1 = Label (
23
23
frame ,
24
- text = ("Run a Test in Chrome:" ),
24
+ text = ("Run a Test in Chrome (default) :" ),
25
25
fg = "blue" ,
26
26
).pack ()
27
27
self .run1 = Button (
28
28
frame ,
29
29
command = self .run_1 ,
30
- text = ("pytest my_first_test.py --browser=chrome " ),
30
+ text = ("pytest my_first_test.py" ),
31
31
fg = "green" ,
32
32
).pack ()
33
33
self .title2 = Label (
@@ -38,7 +38,7 @@ def __init__(self, master):
38
38
self .run2 = Button (
39
39
frame ,
40
40
command = self .run_2 ,
41
- text = ("pytest my_first_test.py --browser= firefox" ),
41
+ text = ("pytest my_first_test.py --firefox" ),
42
42
fg = "green" ,
43
43
).pack ()
44
44
self .title3 = Label (
@@ -49,40 +49,40 @@ def __init__(self, master):
49
49
self .run3 = Button (
50
50
frame ,
51
51
command = self .run_3 ,
52
- text = ("pytest my_first_test.py --browser=chrome -- demo_mode" ),
52
+ text = ("pytest my_first_test.py --demo_mode" ),
53
53
fg = "green" ,
54
54
).pack ()
55
55
self .title4 = Label (
56
56
frame ,
57
- text = "Run a Parameterized Test:" ,
57
+ text = "Run a Parameterized Test and reuse session :" ,
58
58
fg = "blue" ,
59
59
).pack ()
60
60
self .run4 = Button (
61
61
frame ,
62
62
command = self .run_4 ,
63
- text = ("pytest parameterized_test.py --browser=chrome " ),
63
+ text = ("pytest parameterized_test.py --rs " ),
64
64
fg = "green" ,
65
65
).pack ()
66
66
self .title5 = Label (
67
67
frame ,
68
- text = "Run a Failing Test (automatic screenshots) :" ,
68
+ text = "Run a Failing Test with a Test Report :" ,
69
69
fg = "blue" ,
70
70
).pack ()
71
71
self .run5 = Button (
72
72
frame ,
73
73
command = self .run_5 ,
74
- text = ("pytest test_fail.py --browser=chrome " ),
74
+ text = ("pytest test_fail.py --html=report.html " ),
75
75
fg = "red" ,
76
76
).pack ()
77
77
self .title6 = Label (
78
78
frame ,
79
- text = "Run a Failing Test Suite with a Test Report :" ,
79
+ text = "Run a Failing Test Suite with the Dashboard :" ,
80
80
fg = "blue" ,
81
81
).pack ()
82
82
self .run6 = Button (
83
83
frame ,
84
84
command = self .run_6 ,
85
- text = ("pytest test_suite.py --browser=chrome --html=report.html " ),
85
+ text = ("pytest test_suite.py --rs --dashboard " ),
86
86
fg = "red" ,
87
87
).pack ()
88
88
self .title7 = Label (
@@ -93,37 +93,37 @@ def __init__(self, master):
93
93
self .run7 = Button (
94
94
frame ,
95
95
command = self .run_7 ,
96
- text = ("pytest test_deferred_asserts.py --browser=chrome " ),
96
+ text = ("pytest test_deferred_asserts.py" ),
97
97
fg = "red" ,
98
98
).pack ()
99
99
self .end_title = Label (frame , text = "" , fg = "black" ).pack ()
100
100
self .quit = Button (frame , text = "QUIT" , command = frame .quit ).pack ()
101
101
102
102
def run_1 (self ):
103
- os . system ("pytest my_first_test.py --browser=chrome" )
103
+ subprocess . Popen ("pytest my_first_test.py" , shell = True )
104
104
105
105
def run_2 (self ):
106
- os . system ("pytest my_first_test.py --browser= firefox" )
106
+ subprocess . Popen ("pytest my_first_test.py --firefox" , shell = True )
107
107
108
108
def run_3 (self ):
109
- os . system ("pytest my_first_test.py --browser=chrome -- demo_mode" )
109
+ subprocess . Popen ("pytest my_first_test.py --demo_mode" , shell = True )
110
110
111
111
def run_4 (self ):
112
- os . system ("pytest parameterized_test.py --browser=chrome" )
112
+ subprocess . Popen ("pytest parameterized_test.py --rs" , shell = True )
113
113
114
114
def run_5 (self ):
115
- os . system ("pytest test_fail.py --browser=chrome" )
115
+ subprocess . Popen ("pytest test_fail.py --html=report.html" , shell = True )
116
116
117
117
def run_6 (self ):
118
- os . system ("pytest test_suite.py --browser=chrome --html=report.html" )
118
+ subprocess . Popen ("pytest test_suite.py --rs --dashboard" , shell = True )
119
119
120
120
def run_7 (self ):
121
- os . system ("pytest test_deferred_asserts.py --browser=chrome" )
121
+ subprocess . Popen ("pytest test_deferred_asserts.py" , shell = True )
122
122
123
123
124
124
if __name__ == "__main__" :
125
125
root = Tk ()
126
126
root .title ("Select Test Job To Run" )
127
- root .minsize (500 , 420 )
127
+ root .minsize (320 , 420 )
128
128
app = App (root )
129
129
root .mainloop ()
0 commit comments