Skip to content

Commit 0ceba13

Browse files
authored
Merge pull request #265 from seleniumbase/update-console-scripts
Update console scripts and traffic-generation code
2 parents ca6d9e3 + bac07fb commit 0ceba13

File tree

4 files changed

+46
-36
lines changed

4 files changed

+46
-36
lines changed

seleniumbase/console_scripts/run.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,22 @@ def show_usage():
2727
show_basic_usage()
2828
print('Type "seleniumbase --help" for details on all commands.')
2929
print('Type "seleniumbase help [COMMAND]" for specific command info.')
30-
print('* Use "pytest" for running tests. *\n')
30+
print('* (Use "pytest" for running tests) *\n')
3131

3232

3333
def show_basic_usage():
3434
seleniumbase_logo = logo_helper.get_seleniumbase_logo()
3535
print(seleniumbase_logo)
3636
print("")
3737
print('Usage: "seleniumbase [COMMAND] [PARAMETERS]"')
38-
print("")
3938
print("Commands:")
40-
print(' "seleniumbase" +')
4139
print(" install [DRIVER_NAME]")
4240
print(" mkdir [NEW_TEST_DIRECTORY_NAME]")
4341
print(" convert [PYTHON_WEBDRIVER_UNITTEST_FILE]")
44-
print(" download server")
45-
print(" grid-hub {start|stop|restart} [OPTIONS]")
46-
print(" grid-node {start|stop|restart} --hub=[HUB_IP] [OPTIONS]")
47-
print("")
48-
print(' * (Example: "seleniumbase install chromedriver") *')
42+
print(" download [ITEM]")
43+
print(" grid-hub [start|stop|restart] [OPTIONS]")
44+
print(" grid-node [start|stop|restart] --hub=[HUB_IP] [OPTIONS]")
45+
print(' * (EXAMPLE: "seleniumbase install chromedriver") *')
4946
print("")
5047

5148

seleniumbase/fixtures/base_case.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,14 +1879,16 @@ def generate_referral(self, start_page, destination_page):
18791879
% start_page)
18801880
self.open(start_page)
18811881
time.sleep(0.08)
1882-
referral_link = ('''<a class='analytics referral test' href='%s' '''
1882+
self.wait_for_ready_state_complete()
1883+
referral_link = ('''<body>'''
1884+
'''<a class='analytics referral test' href='%s' '''
18831885
'''style='font-family: Arial,sans-serif; '''
18841886
'''font-size: 30px; color: #18a2cd'>'''
1885-
'''Magic Link Button</a>''' % destination_page)
1887+
'''Magic Link Button</a></body>''' % destination_page)
18861888
self.execute_script(
1887-
'''document.body.innerHTML = \"%s\"''' % referral_link)
1888-
time.sleep(0.1)
1889-
self.click("a.analytics.referral.test") # Clicks the generated button
1889+
'''document.body.outerHTML = \"%s\"''' % referral_link)
1890+
self.click(
1891+
"a.analytics.referral.test", timeout=2) # Clicks generated button
18901892
time.sleep(0.15)
18911893
try:
18921894
self.click("html")

setup.py

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

1818
setup(
1919
name='seleniumbase',
20-
version='1.17.20',
20+
version='1.17.21',
2121
description='Reliable Browser Automation & Testing Framework',
2222
long_description=long_description,
2323
long_description_content_type='text/markdown',

virtualenv_install.sh

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,36 @@
44
#
55
# Run by using the following command: "source virtualenv_install.sh"
66

7-
python -m pip install --upgrade virtualenv
8-
python -m pip install --upgrade virtualenvwrapper
9-
source `which virtualenvwrapper.sh`
10-
export WORKON_HOME=$HOME/.virtualenvs
11-
echo ""
12-
echo ""
13-
echo 'virtualenv commands will only work if you installed this using "source":'
14-
echo ' *** "source virtualenv_install.sh" ***'
15-
echo ""
16-
echo ""
17-
echo "*** You may now use virtualenv commands in your command shell. ***"
18-
echo ""
19-
echo "virtualenv commands:"
20-
echo ' * "mkvirtualenv [ENV_NAME]" - Create a Python virtual environment'
21-
echo ' * "deactivate" - Exit the current virtual environment'
22-
echo ' * "workon [ENV_NAME]" - Enter an existing virtual environment'
23-
echo ' * "lsvirtualenv" OR "workon" - List all virtual environments'
24-
echo ' * "rmvirtualenv [ENV_NAME]" - Delete a virtual environment'
25-
echo ""
26-
echo "Example:"
27-
echo " mkvirtualenv seleniumbase "
28-
echo ""
7+
[[ $0 != "$BASH_SOURCE" ]] && sourced=1 || sourced=0
8+
if [ $sourced = 1 ]
9+
then
10+
python -m pip install --upgrade virtualenv
11+
python -m pip install --upgrade virtualenvwrapper
12+
source `which virtualenvwrapper.sh`
13+
export WORKON_HOME=$HOME/.virtualenvs
14+
echo ""
15+
echo ""
16+
echo "*** You may now use virtualenv commands in your command shell. ***"
17+
echo ""
18+
echo "virtualenv commands:"
19+
echo ' * "mkvirtualenv [ENV_NAME]" - Create a Python virtual environment'
20+
echo ' * "deactivate" - Exit the current virtual environment'
21+
echo ' * "workon [ENV_NAME]" - Enter an existing virtual environment'
22+
echo ' * "lsvirtualenv" OR "workon" - List all virtual environments'
23+
echo ' * "rmvirtualenv [ENV_NAME]" - Delete a virtual environment'
24+
echo ""
25+
echo "Example:"
26+
echo " mkvirtualenv seleniumbase "
27+
echo ""
28+
else
29+
echo ""
30+
echo "--------------------"
31+
echo '*** - WARNING! - ***'
32+
echo "--------------------"
33+
echo ""
34+
echo 'You need to "source" this file for virtualenv commands to work!'
35+
echo ""
36+
echo '*** USE: source virtualenv_install.sh'
37+
echo " ----------------------------"
38+
echo ""
39+
fi

0 commit comments

Comments
 (0)