Skip to content

Commit 5ab6a66

Browse files
authored
Merge pull request #799 from seleniumbase/update-console-output-and-more
Update console output, Dockerfile, and Python dependencies
2 parents 0786e35 + e538350 commit 5ab6a66

File tree

7 files changed

+50
-43
lines changed

7 files changed

+50
-43
lines changed

Dockerfile

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ FROM ubuntu:18.04
44
#=======================================
55
# Install Python and Basic Python Tools
66
#=======================================
7-
RUN apt-get update && apt-get install -y python python-pip python-setuptools python-dev python-distribute
8-
# Above command on Windows
9-
#RUN apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update
10-
#RUN apt-get install -y python python-pip python-setuptools python-dev python-distribute
7+
RUN apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update
8+
RUN apt-get install -y python3 python3-pip python3-setuptools python3-dev python-distribute
9+
RUN alias python=python3
10+
RUN echo "alias python=python3" >> ~/.bashrc
1111

1212
#=================================
1313
# Install Bash Command Line Tools
@@ -32,13 +32,6 @@ RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-ke
3232
apt-get -yqq install google-chrome-stable && \
3333
rm -rf /var/lib/apt/lists/*
3434

35-
#==================
36-
# Configure Chrome
37-
#==================
38-
RUN dpkg-divert --add --rename --divert /opt/google/chrome/google-chrome.real /opt/google/chrome/google-chrome && \
39-
echo "#!/bin/bash\nexec /opt/google/chrome/google-chrome.real --disable-setuid-sandbox --no-sandbox \"\$@\"" > /opt/google/chrome/google-chrome && \
40-
chmod 755 /opt/google/chrome/google-chrome
41-
4235
#=================
4336
# Install Firefox
4437
#=================
@@ -61,6 +54,20 @@ RUN Xvfb -ac :99 -screen 0 1280x1024x16 > /dev/null 2>&1 &
6154
RUN export DISPLAY=:99
6255
RUN exec "$@"
6356

57+
#=======================
58+
# Update Python Version
59+
#=======================
60+
RUN apt-get update -y
61+
RUN apt-get -qy --no-install-recommends install python3.8
62+
RUN rm /usr/bin/python3
63+
RUN ln -s python3.8 /usr/bin/python3
64+
65+
#=============================================
66+
# Allow Special Characters in Python Programs
67+
#=============================================
68+
RUN export PYTHONIOENCODING=utf8
69+
RUN echo "export PYTHONIOENCODING=utf8" >> ~/.bashrc
70+
6471
#=====================
6572
# Set up SeleniumBase
6673
#=====================
@@ -71,11 +78,11 @@ COPY requirements.txt /SeleniumBase/requirements.txt
7178
COPY setup.py /SeleniumBase/setup.py
7279
RUN find -name '*.pyc' -delete
7380
RUN find -name __pycache__ -delete
74-
RUN pip install --upgrade pip
75-
RUN pip install --upgrade setuptools
76-
RUN pip install --upgrade setuptools-scm
77-
RUN cd /SeleniumBase && ls && pip install -r requirements.txt --upgrade
78-
RUN cd /SeleniumBase && python setup.py develop
81+
RUN pip3 install --upgrade pip
82+
RUN pip3 install --upgrade setuptools
83+
RUN pip3 install --upgrade setuptools-scm
84+
RUN cd /SeleniumBase && ls && pip3 install -r requirements.txt --upgrade
85+
RUN cd /SeleniumBase && python3 setup.py develop
7986
RUN seleniumbase install chromedriver
8087
RUN seleniumbase install geckodriver
8188

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pip>=20.3.4;python_version<"3.6"
22
pip>=21.0;python_version>="3.6"
3-
packaging>=20.8
3+
packaging>=20.9
44
setuptools>=44.1.1;python_version<"3.5"
55
setuptools>=50.3.2;python_version>="3.5" and python_version<"3.6"
66
setuptools>=52.0.0;python_version>="3.6"
@@ -71,7 +71,7 @@ pymysql==0.10.1;python_version<"3.6"
7171
pymysql==1.0.2;python_version>="3.6"
7272
coverage==5.4
7373
brython==3.9.1
74-
pyotp==2.4.1
74+
pyotp==2.5.1
7575
boto==2.49.0
7676
cffi==1.14.4
7777
toml==0.10.2

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "1.54.0"
2+
__version__ = "1.54.1"

seleniumbase/console_scripts/run.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ def show_basic_usage():
6666
sc += ("\n")
6767
sc += ("COMMANDS:\n")
6868
sc += (" install [DRIVER] [OPTIONS]\n")
69+
sc += (" options (List common pytest options)\n")
6970
sc += (" mkdir [DIRECTORY] [OPTIONS]\n")
7071
sc += (" mkfile [FILE.py] [OPTIONS]\n")
71-
sc += (" mkpres [FILE.py] [LANGUAGE OPTIONS]\n")
72-
sc += (" options (List common pytest options)\n")
72+
sc += (" mkpres [FILE.py] [LANG]\n")
7373
sc += (" print [FILE] [OPTIONS]\n")
7474
sc += (" translate [SB_FILE.py] [LANG] [ACTION]\n")
7575
sc += (" convert [WEBDRIVER_UNITTEST_FILE.py]\n")
@@ -79,7 +79,7 @@ def show_basic_usage():
7979
sc += (" revert-objects [SB_FILE.py] [OPTIONS]\n")
8080
sc += (" encrypt (OR: obfuscate)\n")
8181
sc += (" decrypt (OR: unobfuscate)\n")
82-
sc += (" download server (Selenium Server JAR file)\n")
82+
sc += (" download server (The Selenium Grid JAR file)\n")
8383
sc += (" grid-hub [start|stop] [OPTIONS]\n")
8484
sc += (" grid-node [start|stop] --hub=[HOST/IP]\n")
8585
sc += (' * (EXAMPLE: "sbase install chromedriver latest") *\n')
@@ -193,10 +193,10 @@ def show_mkpres_usage():
193193
print(sc)
194194
print("")
195195
print(" Usage:")
196-
print(" seleniumbase mkpres [FILE.py] [LANGUAGE OPTIONS]")
197-
print(" OR: sbase mkpres [FILE.py] [LANGUAGE OPTIONS]")
196+
print(" seleniumbase mkpres [FILE.py] [LANG]")
197+
print(" OR: sbase mkpres [FILE.py] [LANG]")
198198
print(" Example:")
199-
print(" sbase mkpres new_presentation.py")
199+
print(" sbase mkpres new_presentation.py --en")
200200
print(" Language Options:")
201201
print(" --en / --English | --zh / --Chinese")
202202
print(" --nl / --Dutch | --fr / --French")
@@ -257,8 +257,8 @@ def show_translate_usage():
257257
print(sc)
258258
print("")
259259
print(" Usage:")
260-
print(" seleniumbase translate [SB_FILE.py] [LANGUAGE] [ACTION]")
261-
print(" OR: sbase translate [SB_FILE.py] [LANGUAGE] [ACTION]")
260+
print(" seleniumbase translate [SB_FILE.py] [LANG] [ACTION]")
261+
print(" OR: sbase translate [SB_FILE.py] [LANG] [ACTION]")
262262
print(" Languages:")
263263
print(" --en / --English | --zh / --Chinese")
264264
print(" --nl / --Dutch | --fr / --French")
@@ -309,8 +309,8 @@ def show_inject_objects_usage():
309309
print(sc)
310310
print("")
311311
print(" Usage:")
312-
print(" seleniumbase inject-objects [SB_FILE.py]")
313-
print(" OR: sbase inject-objects [SB_FILE.py]")
312+
print(" seleniumbase inject-objects [SB_FILE.py] [OPTIONS]")
313+
print(" OR: sbase inject-objects [SB_FILE.py] [OPTIONS]")
314314
print(" Options:")
315315
print(" -c, --comments (Add object selectors to the comments.)")
316316
print(" (Default: No added comments.)")
@@ -329,8 +329,8 @@ def show_objectify_usage():
329329
print(sc)
330330
print("")
331331
print(" Usage:")
332-
print(" seleniumbase objectify [SB_FILE.py]")
333-
print(" OR: sbase objectify [SB_FILE.py]")
332+
print(" seleniumbase objectify [SB_FILE.py] [OPTIONS]")
333+
print(" OR: sbase objectify [SB_FILE.py] [OPTIONS]")
334334
print(" Options:")
335335
print(" -c, --comments (Add object selectors to the comments.)")
336336
print(" (Default: No added comments.)")
@@ -352,8 +352,8 @@ def show_revert_objects_usage():
352352
print(sc)
353353
print("")
354354
print(" Usage:")
355-
print(" seleniumbase revert-objects [SB_FILE.py]")
356-
print(" OR: sbase revert-objects [SB_FILE.py]")
355+
print(" seleniumbase revert-objects [SB_FILE.py] [OPTIONS]")
356+
print(" OR: sbase revert-objects [SB_FILE.py] [OPTIONS]")
357357
print(" Options:")
358358
print(" -c, --comments (Keep existing comments for the lines.)")
359359
print(" (Default: No comments are kept.)")

seleniumbase/console_scripts/sb_mkpres.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
Creates a new SeleniumBase presentation with boilerplate code.
44
55
Usage:
6-
seleniumbase mkpres [FILE.py] [LANGUAGE OPTIONS]
7-
or sbase mkpres [FILE.py] [LANGUAGE OPTIONS]
6+
seleniumbase mkpres [FILE.py] [LANG]
7+
or sbase mkpres [FILE.py] [LANG]
88
99
Example:
10-
sbase mkpres new_presentation.py
10+
sbase mkpres new_presentation.py --en
1111
1212
Language Options:
1313
--en / --English | --zh / --Chinese
@@ -33,10 +33,10 @@
3333
def invalid_run_command(msg=None):
3434
exp = (" ** mkpres **\n\n")
3535
exp += " Usage:\n"
36-
exp += " seleniumbase mkpres [FILE.py] [LANGUAGE OPTIONS]\n"
37-
exp += " OR sbase mkpres [FILE.py] [LANGUAGE OPTIONS]\n"
36+
exp += " seleniumbase mkpres [FILE.py] [LANG]\n"
37+
exp += " OR sbase mkpres [FILE.py] [LANG]\n"
3838
exp += " Example:\n"
39-
exp += " sbase mkpres new_presentation.py\n"
39+
exp += " sbase mkpres new_presentation.py --en\n"
4040
exp += " Language Options:\n"
4141
exp += " --en / --English | --zh / --Chinese\n"
4242
exp += " --nl / --Dutch | --fr / --French\n"

seleniumbase/fixtures/page_actions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ def hover_element(driver, element):
113113

114114

115115
def timeout_exception(exception, message):
116-
exc, message = s_utils.format_exc(exception, message)
117-
raise exc(message)
116+
exception, message = s_utils.format_exc(exception, message)
117+
raise exception(message)
118118

119119

120120
def hover_and_click(driver, hover_selector, click_selector,

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
install_requires=[
105105
'pip>=20.3.4;python_version<"3.6"',
106106
'pip>=21.0;python_version>="3.6"',
107-
'packaging>=20.8',
107+
'packaging>=20.9',
108108
'setuptools>=44.1.1;python_version<"3.5"',
109109
'setuptools>=50.3.2;python_version>="3.5" and python_version<"3.6"',
110110
'setuptools>=52.0.0;python_version>="3.6"',
@@ -175,7 +175,7 @@
175175
'pymysql==1.0.2;python_version>="3.6"',
176176
'coverage==5.4',
177177
'brython==3.9.1',
178-
'pyotp==2.4.1',
178+
'pyotp==2.5.1',
179179
'boto==2.49.0',
180180
'cffi==1.14.4',
181181
'toml==0.10.2',

0 commit comments

Comments
 (0)