diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index dc617b296e0..790691ed035 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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 diff --git a/examples/gui_test_runner.py b/examples/gui_test_runner.py index 5b495787059..b70896ba828 100755 --- a/examples/gui_test_runner.py +++ b/examples/gui_test_runner.py @@ -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: @@ -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( @@ -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( @@ -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( @@ -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() diff --git a/examples/wordle_test.py b/examples/wordle_test.py index 8e503abbab0..6b14ccd847d 100644 --- a/examples/wordle_test.py +++ b/examples/wordle_test.py @@ -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 " diff --git a/mkdocs_build/requirements.txt b/mkdocs_build/requirements.txt index a13482d494c..03017691238 100644 --- a/mkdocs_build/requirements.txt +++ b/mkdocs_build/requirements.txt @@ -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" diff --git a/seleniumbase/__version__.py b/seleniumbase/__version__.py index becdc69dbae..25f16ab3973 100755 --- a/seleniumbase/__version__.py +++ b/seleniumbase/__version__.py @@ -1,2 +1,2 @@ # seleniumbase package -__version__ = "2.4.10" +__version__ = "2.4.11" diff --git a/seleniumbase/console_scripts/sb_mkrec.py b/seleniumbase/console_scripts/sb_mkrec.py index c0139725184..a59d80a0044 100755 --- a/seleniumbase/console_scripts/sb_mkrec.py +++ b/seleniumbase/console_scripts/sb_mkrec.py @@ -76,6 +76,7 @@ def set_colors(use_colors): def main(): + platform = sys.platform help_me = False error_msg = None invalid_cmd = None @@ -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) @@ -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": diff --git a/seleniumbase/console_scripts/sb_recorder.py b/seleniumbase/console_scripts/sb_recorder.py index ee883b0af6c..1a2c6b5c7af 100755 --- a/seleniumbase/console_scripts/sb_recorder.py +++ b/seleniumbase/console_scripts/sb_recorder.py @@ -12,6 +12,7 @@ import colorama import os +import subprocess import sys from seleniumbase.fixtures import page_utils @@ -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) @@ -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)