Skip to content

Commit 6d15d0a

Browse files
authored
Merge pull request #255 from seleniumbase/console-scripts-update
Update the SeleniumBase console scripts interface
2 parents c50442f + d6d857f commit 6d15d0a

File tree

6 files changed

+77
-9
lines changed

6 files changed

+77
-9
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ install:
1919
- "python setup.py develop"
2020
- "sudo rm -f /etc/boto.cfg"
2121
before_script:
22-
- "flake8 --ignore FutureWarning seleniumbase/*.py && flake8 --ignore FutureWarning seleniumbase/*/*.py && flake8 --ignore FutureWarning seleniumbase/*/*/*.py && flake8 --ignore FutureWarning seleniumbase/*/*/*/*.py"
22+
- "flake8 seleniumbase/*.py && flake8 seleniumbase/*/*.py && flake8 seleniumbase/*/*/*.py && flake8 seleniumbase/*/*/*/*.py"
2323
# - "wget https://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip && unzip chromedriver_linux64.zip && sudo cp chromedriver /usr/local/bin/ && sudo chmod +x /usr/local/bin/chromedriver"
2424
# - "wget https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz -O /tmp/geckodriver.tar.gz && tar -C /opt -xzf /tmp/geckodriver.tar.gz && sudo chmod 755 /opt/geckodriver && sudo ln -fs /opt/geckodriver /usr/bin/geckodriver && sudo ln -fs /opt/geckodriver /usr/local/bin/geckodriver"
2525
# - "wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 && tar -xvf ./phantomjs-2.1.1-linux-x86_64.tar.bz2 && export PATH=$PWD/phantomjs-2.1.1-linux-x86_64/bin:$PATH"
26+
- "seleniumbase"
2627
- "seleniumbase install chromedriver"
2728
- "seleniumbase install geckodriver"
2829
- "seleniumbase mkdir browser_tests"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_2h2.png" title="SeleniumBase" height="48">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
22

3-
[<img src="https://img.shields.io/github/release/seleniumbase/SeleniumBase.svg" />](https://github.com/seleniumbase/SeleniumBase/releases) [<img src="https://img.shields.io/badge/python-2.7,_3.x-22AADD.svg" alt="Python versions" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://travis-ci.org/seleniumbase/SeleniumBase.svg?branch=master" alt="Build Status" />](https://travis-ci.org/seleniumbase/SeleniumBase) [<img src="https://img.shields.io/github/issues-closed-raw/seleniumbase/SeleniumBase.svg" alt="Closed Issues" />](https://github.com/seleniumbase/SeleniumBase/issues?q=is%3Aissue+is%3Aclosed) [<img src="https://img.shields.io/badge/pypi-seleniumbase-forestgreen.svg" alt="pypi" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="Join the Gitter Chat" />](https://gitter.im/seleniumbase/SeleniumBase) [<img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg" alt="GitHub Stars" />](https://github.com/seleniumbase/SeleniumBase/stargazers) [<img src="http://img.shields.io/badge/license-MIT-22BBCC.svg" alt="MIT License" />](https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE)<br />
3+
[<img src="https://img.shields.io/github/release/seleniumbase/SeleniumBase.svg" />](https://github.com/seleniumbase/SeleniumBase/releases) [<img src="https://img.shields.io/badge/python-2.7,_3.x-22AADD.svg" alt="Python versions" />](https://github.com/seleniumbase/SeleniumBase/blob/master/.travis.yml) [<img src="https://travis-ci.org/seleniumbase/SeleniumBase.svg?branch=master" alt="Build Status" />](https://travis-ci.org/seleniumbase/SeleniumBase) [<img src="https://img.shields.io/github/issues-closed-raw/seleniumbase/SeleniumBase.svg" alt="Closed Issues" />](https://github.com/seleniumbase/SeleniumBase/issues?q=is%3Aissue+is%3Aclosed) [<img src="https://img.shields.io/badge/pypi-seleniumbase-forestgreen.svg" alt="pypi" />](https://pypi.python.org/pypi/seleniumbase) [<img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt="Join the Gitter Chat" />](https://gitter.im/seleniumbase/SeleniumBase) [<img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg" alt="GitHub Stars" />](https://github.com/seleniumbase/SeleniumBase/stargazers) [<img src="http://img.shields.io/badge/license-MIT-22BBCC.svg" alt="MIT License" />](https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE)<br />
44

55
A complete framework for web automation, end-to-end testing, and [interactive walkthroughs](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md). SeleniumBase uses [Pytest](https://docs.pytest.org/en/latest/) for running Python scripts, while using [WebDriver](https://www.seleniumhq.org/) for controlling web browsers.
66

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pytest-rerunfailures>=5.0
1515
pytest-xdist>=1.24.1
1616
parameterized==0.6.1
1717
beautifulsoup4>=4.6.0
18+
colorama==0.4.1
1819
pyotp>=2.2.7
1920
boto>=2.49.0
2021
flake8==3.6.0
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
""" SeleniumBase Logo Processing (for the console scripts interface)
2+
Logo generated from:
3+
http://www.patorjk.com/software/taag/#p=display&f=Slant&t=SeleniumBase """
4+
5+
import colorama
6+
7+
r'''
8+
______ __ _ ____
9+
/ ____/__ / /__ ____ (_)_ ______ ___ / __ `____ ________
10+
\__ \/ _ \/ / _ \/ __ \/ / / / / __ `__ \/ /_/ / __ `/ ___/ _ \
11+
___/ / __/ / __/ / / / / /_/ / / / / / / /_) / /_/ (__ ) __/
12+
/____/\___/_/\___/_/ /_/_/\__,_/_/ /_/ /_/_____/\__,_/____/\___/
13+
'''
14+
15+
16+
def get_seleniumbase_logo():
17+
colorama.init(autoreset=True)
18+
c1 = colorama.Fore.BLUE + colorama.Back.CYAN
19+
c2 = colorama.Fore.CYAN + colorama.Back.BLUE
20+
cr = colorama.Style.RESET_ALL
21+
sb = " "
22+
sb += c1
23+
sb += "\n"
24+
sb += c1
25+
sb += " ______ __ _ "
26+
sb += c2
27+
sb += "____ "
28+
sb += c1
29+
sb += "\n"
30+
sb += c1
31+
sb += " / ____/__ / /__ ____ (_)_ ______ ___ "
32+
sb += c2
33+
sb += "/ __ `____ ________ "
34+
sb += c1
35+
sb += "\n"
36+
sb += c1
37+
sb += " \\__ \\/ _ \\/ / _ \\/ __ \\/ / / / / __ `__ \\"
38+
sb += c2
39+
sb += "/ /_/ / __ `/ ___/ _ \\"
40+
sb += c1
41+
sb += "\n"
42+
sb += c1
43+
sb += " ___/ / __/ / __/ / / / / /_/ / / / / / "
44+
sb += c2
45+
sb += "/ /_) / /_/ (__ ) __/"
46+
sb += c1
47+
sb += "\n"
48+
sb += c1
49+
sb += "/____/\\___/_/\\___/_/ /_/_/\\__,_/_/ /_/ /_"
50+
sb += c2
51+
sb += "/_____/\\__,_/____/\\___/ "
52+
sb += c1
53+
sb += "\n"
54+
sb += c1
55+
sb += " "
56+
sb += c2
57+
sb += " "
58+
sb += c1
59+
sb += cr
60+
return sb

seleniumbase/console_scripts/run.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"""
1515

1616
import sys
17+
from seleniumbase.console_scripts import logo_helper
1718
from seleniumbase.console_scripts import sb_mkdir
1819
from seleniumbase.console_scripts import sb_install
1920
from seleniumbase.utilities.selenium_grid import download_selenium_server
@@ -24,21 +25,25 @@
2425

2526
def show_usage():
2627
show_basic_usage()
27-
print('Type "seleniumbase help" for details on all commands. OR,')
28-
print('Type "seleniumbase help [COMMAND]" for specific command info.\n')
28+
print('Type "seleniumbase --help" for details on all commands.')
29+
print('Type "seleniumbase help [COMMAND]" for specific command info.')
30+
print('Type "pytest [FILE_OR_DIR]" to run tests in the given location.')
31+
print('Type "pytest --help" to learn more about running tests.\n')
2932

3033

3134
def show_basic_usage():
35+
seleniumbase_logo = logo_helper.get_seleniumbase_logo()
36+
print(seleniumbase_logo)
3237
print("")
33-
print(">>>>>>>>>>>>")
38+
print('Usage: "seleniumbase [COMMAND] [PARAMETERS]"')
39+
print(' * (Example: "seleniumbase install chromedriver")')
3440
print("")
35-
print('Usage: "seleniumbase [command] [parameters]"')
36-
print("")
37-
print("Commands:")
41+
print("Commands with parameters:")
3842
print("")
3943
print(" install [DRIVER_NAME]")
4044
print(" mkdir [NEW_TEST_DIRECTORY_NAME]")
4145
print(" convert [PYTHON_WEBDRIVER_UNITTEST_FILE]")
46+
print(" download server")
4247
print(" grid-hub {start|stop|restart} [OPTIONS]")
4348
print(" grid-node {start|stop|restart} --hub=[HUB_IP] [OPTIONS]")
4449
print("")

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setup(
1919
name='seleniumbase',
20-
version='1.17.11',
20+
version='1.17.12',
2121
description='All-in-One Test Automation Framework',
2222
long_description=long_description,
2323
long_description_content_type='text/markdown',
@@ -68,6 +68,7 @@
6868
'pytest-xdist>=1.24.1',
6969
'parameterized==0.6.1',
7070
'beautifulsoup4>=4.6.0', # Keep at >=4.6.0 while using bs4
71+
'colorama==0.4.1',
7172
'pyotp>=2.2.7',
7273
'boto>=2.49.0',
7374
'flake8==3.6.0',

0 commit comments

Comments
 (0)