Skip to content

Commit dbef904

Browse files
committed
Update SeleniumBase GUI apps
1 parent 5bbbff6 commit dbef904

File tree

2 files changed

+78
-30
lines changed

2 files changed

+78
-30
lines changed

seleniumbase/console_scripts/sb_behave_gui.py

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def do_behave_run(
163163
def create_tkinter_gui(tests, command_string):
164164
root = tk.Tk()
165165
root.title("SeleniumBase Behave Commander | GUI for Behave")
166-
root.minsize(820, 645)
166+
root.minsize(820, 656)
167167
tk.Label(root, text="").pack()
168168

169169
options_list = [
@@ -189,31 +189,39 @@ def create_tkinter_gui(tests, command_string):
189189
question_menu.pack()
190190

191191
qmx = tk.IntVar()
192-
chk = tk.Checkbutton(root, text="Quiet Mode (--quiet)", variable=qmx)
192+
chk = tk.Checkbutton(
193+
root, text="Quiet Mode (--quiet)", variable=qmx, pady=0
194+
)
193195
chk.pack()
194196

195197
dmx = tk.IntVar()
196-
chk = tk.Checkbutton(root, text="Demo Mode (-D demo)", variable=dmx)
198+
chk = tk.Checkbutton(
199+
root, text="Demo Mode (-D demo)", variable=dmx, pady=0
200+
)
197201
chk.pack()
198202

199203
mmx = tk.IntVar()
200-
chk = tk.Checkbutton(root, text="Mobile Mode (-D mobile)", variable=mmx)
204+
chk = tk.Checkbutton(
205+
root, text="Mobile Mode (-D mobile)", variable=mmx, pady=0
206+
)
201207
chk.pack()
202208

203209
dbx = tk.IntVar()
204-
chk = tk.Checkbutton(root, text="Dashboard (-D dashboard)", variable=dbx)
210+
chk = tk.Checkbutton(
211+
root, text="Dashboard (-D dashboard)", variable=dbx, pady=0
212+
)
205213
chk.pack()
206214
chk.select()
207215

208216
hbx = tk.IntVar()
209217
chk = tk.Checkbutton(
210-
root, text="Headless Browser (-D headless)", variable=hbx
218+
root, text="Headless Browser (-D headless)", variable=hbx, pady=0
211219
)
212220
chk.pack()
213221

214222
ssx = tk.IntVar()
215223
chk = tk.Checkbutton(
216-
root, text="Save Screenshots (-D screenshot)", variable=ssx
224+
root, text="Save Screenshots (-D screenshot)", variable=ssx, pady=0
217225
)
218226
chk.pack()
219227

@@ -235,13 +243,27 @@ def create_tkinter_gui(tests, command_string):
235243
for row in tests:
236244
row += " " * 200
237245
ara[count] = tk.IntVar()
238-
cb = tk.Checkbutton(
239-
text_area,
240-
text=(row),
241-
bg="white",
242-
anchor="w",
243-
variable=ara[count],
244-
)
246+
cb = None
247+
if not is_windows:
248+
cb = tk.Checkbutton(
249+
text_area,
250+
text=(row),
251+
bg="white",
252+
anchor="w",
253+
pady=0,
254+
variable=ara[count],
255+
)
256+
else:
257+
cb = tk.Checkbutton(
258+
text_area,
259+
text=(row),
260+
bg="white",
261+
anchor="w",
262+
pady=0,
263+
borderwidth=0,
264+
highlightthickness=0,
265+
variable=ara[count],
266+
)
245267
text_area.window_create("end", window=cb)
246268
text_area.insert("end", "\n")
247269
count += 1

seleniumbase/console_scripts/sb_commander.py

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
import tkinter as tk # noqa: E402
3333
from tkinter.scrolledtext import ScrolledText # noqa: E402
3434

35+
is_windows = False
36+
if sys.platform in ["win32", "win64", "x64"]:
37+
is_windows = True
38+
3539

3640
def set_colors(use_colors):
3741
c0 = ""
@@ -155,7 +159,7 @@ def do_pytest_run(
155159
def create_tkinter_gui(tests, command_string):
156160
root = tk.Tk()
157161
root.title("SeleniumBase Commander | GUI for pytest")
158-
root.minsize(820, 645)
162+
root.minsize(820, 658)
159163
tk.Label(root, text="").pack()
160164

161165
options_list = [
@@ -192,39 +196,47 @@ def create_tkinter_gui(tests, command_string):
192196
question_menu.pack()
193197

194198
vox = tk.IntVar()
195-
chk = tk.Checkbutton(root, text="Verbose Output (-v)", variable=vox)
199+
chk = tk.Checkbutton(
200+
root, text="Verbose Output (-v)", variable=vox, pady=0
201+
)
196202
chk.pack()
197203
chk.select()
198204

199205
dmx = tk.IntVar()
200-
chk = tk.Checkbutton(root, text="Demo Mode (--demo)", variable=dmx)
206+
chk = tk.Checkbutton(
207+
root, text="Demo Mode (--demo)", variable=dmx, pady=0
208+
)
201209
chk.pack()
202210

203211
mmx = tk.IntVar()
204-
chk = tk.Checkbutton(root, text="Mobile Mode (--mobile)", variable=mmx)
212+
chk = tk.Checkbutton(
213+
root, text="Mobile Mode (--mobile)", variable=mmx, pady=0
214+
)
205215
chk.pack()
206216

207217
dbx = tk.IntVar()
208-
chk = tk.Checkbutton(root, text="Dashboard (--dashboard)", variable=dbx)
218+
chk = tk.Checkbutton(
219+
root, text="Dashboard (--dashboard)", variable=dbx, pady=0
220+
)
209221
chk.pack()
210222
chk.select()
211223

212224
hrx = tk.IntVar()
213225
chk = tk.Checkbutton(
214-
root, text="Report (--html=report.html)", variable=hrx
226+
root, text="Report (--html=report.html)", variable=hrx, pady=0
215227
)
216228
chk.pack()
217229
chk.select()
218230

219231
hbx = tk.IntVar()
220232
chk = tk.Checkbutton(
221-
root, text="Headless Browser (--headless)", variable=hbx
233+
root, text="Headless Browser (--headless)", variable=hbx, pady=0
222234
)
223235
chk.pack()
224236

225237
ssx = tk.IntVar()
226238
chk = tk.Checkbutton(
227-
root, text="Save Screenshots (--screenshot)", variable=ssx
239+
root, text="Save Screenshots (--screenshot)", variable=ssx, pady=0
228240
)
229241
chk.pack()
230242

@@ -246,13 +258,27 @@ def create_tkinter_gui(tests, command_string):
246258
for row in tests:
247259
row += " " * 200
248260
ara[count] = tk.IntVar()
249-
cb = tk.Checkbutton(
250-
text_area,
251-
text=(row),
252-
bg="white",
253-
anchor="w",
254-
variable=ara[count],
255-
)
261+
cb = None
262+
if not is_windows:
263+
cb = tk.Checkbutton(
264+
text_area,
265+
text=(row),
266+
bg="white",
267+
anchor="w",
268+
pady=0,
269+
variable=ara[count],
270+
)
271+
else:
272+
cb = tk.Checkbutton(
273+
text_area,
274+
text=(row),
275+
bg="white",
276+
anchor="w",
277+
pady=0,
278+
borderwidth=0,
279+
highlightthickness=0,
280+
variable=ara[count],
281+
)
256282
text_area.window_create("end", window=cb)
257283
text_area.insert("end", "\n")
258284
count += 1
@@ -262,7 +288,7 @@ def create_tkinter_gui(tests, command_string):
262288
aopts = tk.StringVar(value=additional_options)
263289
tk.Label(
264290
root,
265-
text="Additional pytest Options: (space-separated)",
291+
text='Additional "pytest" Options: (Eg. "--incognito --slow")',
266292
fg="blue",
267293
).pack()
268294
entry = tk.Entry(root, textvariable=aopts)

0 commit comments

Comments
 (0)