From c5c8c0b29439e8c5d385a876ba43669e5b21cd64 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Wed, 25 Jul 2018 13:12:01 -0400 Subject: [PATCH 1/3] Update requirements to: six==1.11.0 --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 1d357c452db..5c9a3d1905a 100755 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ nose==1.3.7 pytest==3.6.3 pytest-html==1.19.0 pytest-xdist==1.22.2 -six==1.10.0 +six==1.11.0 flake8==3.5.0 requests==2.19.1 beautifulsoup4==4.6.0 diff --git a/setup.py b/setup.py index 07af6f2fd05..baa5a1aa764 100755 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ 'pytest==3.6.3', 'pytest-html==1.19.0', 'pytest-xdist==1.22.2', - 'six==1.10.0', + 'six==1.11.0', 'flake8==3.5.0', 'requests==2.19.1', 'beautifulsoup4==4.6.0', From d411c4bf1de9b833ffab7e5b3f60e72c6cd180e0 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Wed, 25 Jul 2018 13:13:16 -0400 Subject: [PATCH 2/3] Update console scripts --- console_scripts/run.py | 28 +++++++++++++++++++----- integrations/selenium_ide/convert_ide.py | 22 +++++++++++++------ 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/console_scripts/run.py b/console_scripts/run.py index dacc0ac4c4f..bf652b413e2 100644 --- a/console_scripts/run.py +++ b/console_scripts/run.py @@ -6,7 +6,7 @@ Examples: seleniumbase mkdir [DIRECTORY_NAME] -seleniumbase convert [PYTHON_WEBDRIVER_UNITTEST_FILE].py +seleniumbase convert [PYTHON_WEBDRIVER_UNITTEST_FILE] seleniumbase grid-hub start seleniumbase grid-node start --hub=127.0.0.1 """ @@ -20,7 +20,8 @@ def show_usage(): show_basic_usage() - print('Type "seleniumbase help" for more details.\n') + print('Type "seleniumbase help" for details on all commands. OR,') + print('Type "seleniumbase help [COMMAND]" for specific command info.\n') def show_basic_usage(): @@ -31,8 +32,8 @@ def show_basic_usage(): print("") print("Commands:") print("") - print(" mkdir [DIRECTORY]") - print(" convert [FILENAME]") + print(" mkdir [NEW_TEST_DIRECTORY_NAME]") + print(" convert [PYTHON_WEBDRIVER_UNITTEST_FILE]") print(" grid-hub {start|stop|restart} [OPTIONS]") print(" grid-node {start|stop|restart} --hub=[HUB_IP] [OPTIONS]") print("") @@ -56,7 +57,7 @@ def show_convert_usage(): print(" ** convert **") print("") print(" Usage:") - print(" seleniumbase convert [MY_TEST.py]") + print(" seleniumbase convert [PYTHON_WEBDRIVER_UNITTEST_FILE]") print(" Output:") print(" Converts a Selenium IDE exported WebDriver unittest") print(" file into a SeleniumBase file. Adds _SB to the new") @@ -147,6 +148,23 @@ def main(): show_basic_usage() show_grid_node_usage() elif command == "help" or command == "--help": + if len(command_args) >= 1: + if command_args[0] == "mkdir": + print("") + show_mkdir_usage() + return + elif command_args[0] == "convert": + print("") + show_convert_usage() + return + elif command_args[0] == "grid-hub": + print("") + show_grid_hub_usage() + return + elif command_args[0] == "grid-node": + print("") + show_grid_node_usage() + return show_detailed_help() else: show_usage() diff --git a/integrations/selenium_ide/convert_ide.py b/integrations/selenium_ide/convert_ide.py index bb412a11cd7..484c07afdb2 100755 --- a/integrations/selenium_ide/convert_ide.py +++ b/integrations/selenium_ide/convert_ide.py @@ -4,11 +4,14 @@ Works with Katalon Recorder scripts: http://www.katalon.com/automation-recorder Usage: - seleniumbase convert [MY_TEST.py] + seleniumbase convert [PYTHON_WEBDRIVER_UNITTEST_FILE].py + (run from anywhere) OR - python convert_ide.py [MY_TEST.py] (from the "selenium_ide/"" folder) + python convert_ide.py [PYTHON_WEBDRIVER_UNITTEST_FILE].py + (when run from the "selenium_ide/" folder) Output: - [MY_TEST_SB.py] (Adds "_SB" to the file name) + [NEW_FILE_SB].py (adds "_SB" to the original file name) + (the original file is kept intact) """ import codecs @@ -18,7 +21,7 @@ def main(): expected_arg = ("[A Katalon/Selenium IDE recording exported as " - "a Python-WebDriver script].py") + "a Python-WebDriver unittest script].py") num_args = len(sys.argv) if sys.argv[0].split('/')[-1] == "seleniumbase" or ( sys.argv[0].split('\\')[-1] == "seleniumbase"): @@ -29,9 +32,11 @@ def main(): if num_args < 2 or num_args > 2: raise Exception('\n* INVALID RUN COMMAND! * Usage:\n' '"python convert_ide.py %s"\n' % expected_arg) - if not sys.argv[num_args-1].endswith('.py'): - raise Exception("Not a Python file!") webdriver_python_file = sys.argv[num_args-1] + if not webdriver_python_file.endswith('.py'): + raise Exception("* `%s` is not a Python file! *\n" + "Expecting: %s\n" + % (webdriver_python_file, expected_arg)) seleniumbase_lines = [] seleniumbase_lines.append("from seleniumbase import BaseCase") @@ -47,7 +52,10 @@ def main(): all_code = f.read() f.close() if "def test_" not in all_code: - raise Exception("Not a valid Python unittest.TestCase file!") + raise Exception("* `%s` is not a valid Python unittest.TestCase file! " + "*\nExpecting: %s\n" + "Did you properly export your Selenium-IDE recording " + "as a Python WebDriver unittest file?" % expected_arg) code_lines = all_code.split('\n') for line in code_lines: From 21fdcd5d50edae8c4e7093841866edcc0af7b2e7 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Wed, 25 Jul 2018 13:14:30 -0400 Subject: [PATCH 3/3] Version 1.12.2 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index baa5a1aa764..3a72954e696 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name='seleniumbase', - version='1.12.1', + version='1.12.2', description='Web Automation & Testing Framework - http://seleniumbase.com', long_description='Web Automation and Testing Framework - seleniumbase.com', platforms='Mac * Windows * Linux * Docker',