From 59ac0b5f20af64bb41888521f420aa07bc6f5c0b Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Thu, 11 Jan 2024 23:57:02 +0000 Subject: [PATCH] Print a colored result at the end of autotest.py. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4758 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- tools/autotest.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/autotest.py b/tools/autotest.py index 7087f178..f61559f7 100755 --- a/tools/autotest.py +++ b/tools/autotest.py @@ -20,6 +20,7 @@ tf = subprocess.Popen(['out/debug/tildefriends', 'run', '-d', 'out/selenium.sqli def exists_in_shadow_root(shadow_root, by, value): return lambda driver: shadow_root.find_element(by, value) +success = False try: options = webdriver.FirefoxOptions() #options.add_argument('--headless') @@ -159,9 +160,14 @@ try: driver.find_element(By.TAG_NAME, 'tf-auth').shadow_root.find_element(By.ID, 'loginButton').click() wait.until(expected_conditions.presence_of_element_located((By.ID, 'document'))) - print('SUCCESS.') + success = True finally: driver.close() driver.quit() tf.terminate() + +if success: + print('\033[92mTEST SUCCEEDED.\033[0m') +else: + print('\033[91mTEST FAILED.\033[0m')