Skip to content

Commit 7a79614

Browse files
committed
Make improvements to Recorder Desktop
1 parent 0ea0463 commit 7a79614

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

seleniumbase/console_scripts/sb_mkrec.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def set_colors(use_colors):
7676

7777

7878
def main():
79+
platform = sys.platform
7980
help_me = False
8081
error_msg = None
8182
invalid_cmd = None
@@ -85,7 +86,7 @@ def main():
8586
use_colors = True
8687
force_gui = False
8788

88-
if "linux" in sys.platform:
89+
if "linux" in platform:
8990
use_colors = False
9091
c0, c1, c2, c5, c7, cr = set_colors(use_colors)
9192

@@ -116,11 +117,9 @@ def main():
116117
use_edge = True
117118
elif (
118119
option.lower() in ("--gui", "--headed")
119-
and "linux" in sys.platform
120120
):
121-
use_colors = True
122-
c0, c1, c2, c5, c7, cr = set_colors(use_colors)
123-
force_gui = True
121+
if "linux" in platform:
122+
force_gui = True
124123
elif option.lower().startswith("--url="):
125124
start_page = option[len("--url="):]
126125
elif option.lower() == "--url":

seleniumbase/console_scripts/sb_recorder.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import colorama
1414
import os
15+
import subprocess
1516
import sys
1617
from seleniumbase.fixtures import page_utils
1718

@@ -92,10 +93,10 @@ def do_recording(file_name, url, overwrite_enabled, use_chrome, window):
9293
return
9394
else:
9495
os.remove(file_name)
95-
command = "python -m sbase mkrec %s --url=%s" % (file_name, url)
96+
command = "sbase mkrec %s --url=%s --gui" % (file_name, url)
9697
if not use_chrome:
9798
command += " --edge"
98-
os.system(command)
99+
subprocess.Popen(command, shell=True)
99100
send_window_to_front(window)
100101

101102

@@ -113,12 +114,14 @@ def do_playback(file_name, use_chrome, window, demo_mode=False):
113114
)
114115
return
115116
command = "pytest %s -q -s" % file_name
117+
if "linux" in sys.platform:
118+
command += " --gui"
116119
if not use_chrome:
117120
command += " --edge"
118121
if demo_mode:
119122
command += " --demo"
120123
print(command)
121-
os.system(command)
124+
subprocess.Popen(command, shell=True)
122125
send_window_to_front(window)
123126

124127

0 commit comments

Comments
 (0)