From e5fa7db0d37bef057f97905280c8fac797f8a4ed Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Fri, 11 Feb 2022 01:11:33 -0500 Subject: [PATCH] Update the GUI Test Runner --- examples/gui_test_runner.py | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/gui_test_runner.py b/examples/gui_test_runner.py index 5b495787..b70896ba 100755 --- a/examples/gui_test_runner.py +++ b/examples/gui_test_runner.py @@ -4,7 +4,7 @@ Run by Typing: "python gui_test_runner.py" (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 @@ class App: 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 @@ class App: 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 @@ class App: 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 @@ class App: 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()