Skip to content

Make improvements to Recorder Desktop #1212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ jobs:
- name: Run pytest test_mfa_login.py --browser=chrome --xvfb
run: |
pytest examples/test_mfa_login.py --browser=chrome --xvfb -v -s --junit-xml=junit/test-results.xml
- name: Run pytest test_iframes.py --browser=chrome --xvfb --rs
run: |
pytest examples/test_iframes.py --browser=chrome --xvfb --rs -v -s --junit-xml=junit/test-results.xml
- name: Run pytest test_window_switching.py --browser=chrome --headless
run: |
pytest examples/test_window_switching.py --browser=chrome --headless -v -s --junit-xml=junit/test-results.xml
- name: Run pytest my_first_test.py --browser=chrome --headless
run: |
pytest examples/my_first_test.py --browser=chrome --headless -v -s --junit-xml=junit/test-results.xml
Expand Down
40 changes: 20 additions & 20 deletions examples/gui_test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(Use Python 3 - There are GUI issues when using Python 2)
"""

import os
import subprocess
import sys

if sys.version_info[0] >= 3:
Expand All @@ -21,13 +21,13 @@ def __init__(self, master):
self.title = Label(frame, text="", fg="black").pack()
self.title1 = Label(
frame,
text=("Run a Test in Chrome:"),
text=("Run a Test in Chrome (default):"),
fg="blue",
).pack()
self.run1 = Button(
frame,
command=self.run_1,
text=("pytest my_first_test.py --browser=chrome"),
text=("pytest my_first_test.py"),
fg="green",
).pack()
self.title2 = Label(
Expand All @@ -38,7 +38,7 @@ def __init__(self, master):
self.run2 = Button(
frame,
command=self.run_2,
text=("pytest my_first_test.py --browser=firefox"),
text=("pytest my_first_test.py --firefox"),
fg="green",
).pack()
self.title3 = Label(
Expand All @@ -49,40 +49,40 @@ def __init__(self, master):
self.run3 = Button(
frame,
command=self.run_3,
text=("pytest my_first_test.py --browser=chrome --demo_mode"),
text=("pytest my_first_test.py --demo_mode"),
fg="green",
).pack()
self.title4 = Label(
frame,
text="Run a Parameterized Test:",
text="Run a Parameterized Test and reuse session:",
fg="blue",
).pack()
self.run4 = Button(
frame,
command=self.run_4,
text=("pytest parameterized_test.py --browser=chrome"),
text=("pytest parameterized_test.py --rs"),
fg="green",
).pack()
self.title5 = Label(
frame,
text="Run a Failing Test (automatic screenshots):",
text="Run a Failing Test with a Test Report:",
fg="blue",
).pack()
self.run5 = Button(
frame,
command=self.run_5,
text=("pytest test_fail.py --browser=chrome"),
text=("pytest test_fail.py --html=report.html"),
fg="red",
).pack()
self.title6 = Label(
frame,
text="Run a Failing Test Suite with a Test Report:",
text="Run a Failing Test Suite with the Dashboard:",
fg="blue",
).pack()
self.run6 = Button(
frame,
command=self.run_6,
text=("pytest test_suite.py --browser=chrome --html=report.html"),
text=("pytest test_suite.py --rs --dashboard"),
fg="red",
).pack()
self.title7 = Label(
Expand All @@ -93,37 +93,37 @@ def __init__(self, master):
self.run7 = Button(
frame,
command=self.run_7,
text=("pytest test_deferred_asserts.py --browser=chrome"),
text=("pytest test_deferred_asserts.py"),
fg="red",
).pack()
self.end_title = Label(frame, text="", fg="black").pack()
self.quit = Button(frame, text="QUIT", command=frame.quit).pack()

def run_1(self):
os.system("pytest my_first_test.py --browser=chrome")
subprocess.Popen("pytest my_first_test.py", shell=True)

def run_2(self):
os.system("pytest my_first_test.py --browser=firefox")
subprocess.Popen("pytest my_first_test.py --firefox", shell=True)

def run_3(self):
os.system("pytest my_first_test.py --browser=chrome --demo_mode")
subprocess.Popen("pytest my_first_test.py --demo_mode", shell=True)

def run_4(self):
os.system("pytest parameterized_test.py --browser=chrome")
subprocess.Popen("pytest parameterized_test.py --rs", shell=True)

def run_5(self):
os.system("pytest test_fail.py --browser=chrome")
subprocess.Popen("pytest test_fail.py --html=report.html", shell=True)

def run_6(self):
os.system("pytest test_suite.py --browser=chrome --html=report.html")
subprocess.Popen("pytest test_suite.py --rs --dashboard", shell=True)

def run_7(self):
os.system("pytest test_deferred_asserts.py --browser=chrome")
subprocess.Popen("pytest test_deferred_asserts.py", shell=True)


if __name__ == "__main__":
root = Tk()
root.title("Select Test Job To Run")
root.minsize(500, 420)
root.minsize(320, 420)
app = App(root)
root.mainloop()
2 changes: 1 addition & 1 deletion examples/wordle_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def skip_if_incorrect_env(self):

def test_wordle(self):
self.skip_if_incorrect_env()
self.open("https://www.powerlanguage.co.uk/wordle/")
self.open("https://www.nytimes.com/games/wordle/index.html")
self.click("game-app::shadow game-modal::shadow game-icon")
self.initalize_word_list()
keyboard_base = "game-app::shadow game-keyboard::shadow "
Expand Down
6 changes: 3 additions & 3 deletions mkdocs_build/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ Jinja2==3.0.3;python_version>="3.6"
click==8.0.3;python_version>="3.6"
zipp==3.7.0;python_version>="3.7"
readme-renderer==32.0
pymdown-extensions==9.1;python_version>="3.6"
importlib-metadata==4.10.1;python_version>="3.7"
pymdown-extensions==9.2;python_version>="3.7"
importlib-metadata==4.11.0;python_version>="3.7"
bleach==4.1.0
jsmin==3.0.1;python_version>="3.6"
lunr==0.6.1;python_version>="3.6"
nltk==3.7;python_version>="3.6"
watchdog==2.1.6;python_version>="3.6"
mkdocs==1.2.3;python_version>="3.6"
mkdocs-material==8.1.10;python_version>="3.6"
mkdocs-material==8.1.11;python_version>="3.6"
mkdocs-exclude-search==0.6.4;python_version>="3.6"
mkdocs-simple-hooks==0.1.5
mkdocs-material-extensions==1.0.3;python_version>="3.6"
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "2.4.10"
__version__ = "2.4.11"
9 changes: 4 additions & 5 deletions seleniumbase/console_scripts/sb_mkrec.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def set_colors(use_colors):


def main():
platform = sys.platform
help_me = False
error_msg = None
invalid_cmd = None
Expand All @@ -85,7 +86,7 @@ def main():
use_colors = True
force_gui = False

if "linux" in sys.platform:
if "linux" in platform:
use_colors = False
c0, c1, c2, c5, c7, cr = set_colors(use_colors)

Expand Down Expand Up @@ -116,11 +117,9 @@ def main():
use_edge = True
elif (
option.lower() in ("--gui", "--headed")
and "linux" in sys.platform
):
use_colors = True
c0, c1, c2, c5, c7, cr = set_colors(use_colors)
force_gui = True
if "linux" in platform:
force_gui = True
elif option.lower().startswith("--url="):
start_page = option[len("--url="):]
elif option.lower() == "--url":
Expand Down
9 changes: 6 additions & 3 deletions seleniumbase/console_scripts/sb_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import colorama
import os
import subprocess
import sys
from seleniumbase.fixtures import page_utils

Expand Down Expand Up @@ -92,10 +93,10 @@ def do_recording(file_name, url, overwrite_enabled, use_chrome, window):
return
else:
os.remove(file_name)
command = "python -m sbase mkrec %s --url=%s" % (file_name, url)
command = "sbase mkrec %s --url=%s --gui" % (file_name, url)
if not use_chrome:
command += " --edge"
os.system(command)
subprocess.Popen(command, shell=True)
send_window_to_front(window)


Expand All @@ -113,12 +114,14 @@ def do_playback(file_name, use_chrome, window, demo_mode=False):
)
return
command = "pytest %s -q -s" % file_name
if "linux" in sys.platform:
command += " --gui"
if not use_chrome:
command += " --edge"
if demo_mode:
command += " --demo"
print(command)
os.system(command)
subprocess.Popen(command, shell=True)
send_window_to_front(window)


Expand Down