From 5ea6f1188f50b99c862d492946aa9c8018830419 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Thu, 26 Jul 2018 15:28:50 -0400 Subject: [PATCH 1/6] Update the Dockerfile --- Dockerfile | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 31fa01d3e0f..979ef665521 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # SeleniumBase Docker Image -FROM ubuntu:14.04 +FROM ubuntu:17.10 #======================================= # Install Python and Basic Python Tools @@ -14,6 +14,8 @@ RUN apt-get -qy --no-install-recommends install \ unzip \ wget \ curl \ + libxi6 \ + libgconf-2-4 \ vim \ xvfb \ && rm -rf /var/lib/apt/lists/* @@ -21,17 +23,9 @@ RUN apt-get -qy --no-install-recommends install \ #======================================== # Add normal user with passwordless sudo #======================================== -RUN sudo useradd seluser --shell /bin/bash --create-home \ - && sudo usermod -a -G sudo seluser \ - && echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers - -#============================== -# Locale and encoding settings -#============================== -ENV LANGUAGE en_US.UTF-8 -ENV LANG ${LANGUAGE} -RUN locale-gen ${LANGUAGE} \ - && dpkg-reconfigure --frontend noninteractive locales +#RUN sudo useradd seluser --shell /bin/bash --create-home \ +# && sudo usermod -a -G sudo seluser \ +# && echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers #====================== # Install Chromedriver @@ -96,6 +90,8 @@ RUN exec "$@" #===================== COPY seleniumbase /SeleniumBase/seleniumbase/ COPY examples /SeleniumBase/examples/ +COPY console_scripts /SeleniumBase/console_scripts/ +COPY integrations /SeleniumBase/integrations/ COPY requirements.txt /SeleniumBase/requirements.txt COPY setup.py /SeleniumBase/setup.py RUN pip install --upgrade pip From 60ddc6e03ac1f0d73ffeeb22a146f7acdbb2a2c5 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Thu, 26 Jul 2018 15:30:55 -0400 Subject: [PATCH 2/6] Update methods for link/script additions --- seleniumbase/fixtures/base_case.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/seleniumbase/fixtures/base_case.py b/seleniumbase/fixtures/base_case.py index 0b8d31d7e18..2bfc4dd584a 100755 --- a/seleniumbase/fixtures/base_case.py +++ b/seleniumbase/fixtures/base_case.py @@ -714,6 +714,7 @@ def add_css_link(self, css_link): '''link.rel = "stylesheet"; ''' '''link.type = "text/css"; ''' '''link.href = "%s"; ''' + '''link.crossorigin = "anonymous"; ''' '''document.getElementsByTagName("head")[0]''' '''.appendChild(link);''') self.execute_script(add_css_link_script % css_link) @@ -722,6 +723,8 @@ def add_js_link(self, js_link): script_to_add_js = ( '''var script = document.createElement("script"); ''' '''script.src = "%s"; ''' + '''script.defer; ''' + '''script.crossorigin = "anonymous"; ''' '''document.getElementsByTagName("head")[0]''' '''.appendChild(script);''') self.execute_script(script_to_add_js % js_link) From 7fb2a677ae884c899e2f5dc972415ba47cca4b69 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Thu, 26 Jul 2018 15:32:59 -0400 Subject: [PATCH 3/6] Update Linuxfile.sh to always use the latest chromedriver --- integrations/linux/Linuxfile.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/integrations/linux/Linuxfile.sh b/integrations/linux/Linuxfile.sh index ea07a3b2e3d..beb82535833 100755 --- a/integrations/linux/Linuxfile.sh +++ b/integrations/linux/Linuxfile.sh @@ -52,6 +52,7 @@ sudo apt-get -f install -y --force-yes firefox # Install more dependencies sudo apt-get update +sudo apt-get install -y --force-yes curl sudo apt-get install -y --force-yes xvfb sudo apt-get install -y --force-yes build-essential chrpath libssl-dev libxft-dev sudo apt-get install -y --force-yes libfreetype6 libfreetype6-dev @@ -75,7 +76,8 @@ sudo apt-get -f install -y --force-yes sudo dpkg -i google-chrome-stable_current_amd64.deb # Install Chromedriver -sudo wget -N http://chromedriver.storage.googleapis.com/2.36/chromedriver_linux64.zip -P ~/Downloads +CHROMEDRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` +sudo wget -N http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip -P ~/Downloads sudo unzip -o ~/Downloads/chromedriver_linux64.zip -d ~/Downloads sudo chmod +x ~/Downloads/chromedriver sudo rm -f /usr/local/share/chromedriver From 6e1fdc7df663842a496dc0f081a3ad3b8627602b Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Thu, 26 Jul 2018 15:33:19 -0400 Subject: [PATCH 4/6] Update the Docker ReadMe --- integrations/docker/ReadMe.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/integrations/docker/ReadMe.md b/integrations/docker/ReadMe.md index 13e05e21c5f..8763214a8b0 100755 --- a/integrations/docker/ReadMe.md +++ b/integrations/docker/ReadMe.md @@ -53,6 +53,8 @@ http://stackoverflow.com/questions/17236796/how-to-remove-old-docker-containers Here are a few of those cleanup commands: + docker container prune + docker system prune docker images | grep "" | awk '{print $3}' | xargs docker rmi docker rm 'docker ps --no-trunc -aq' @@ -71,5 +73,5 @@ https://codefresh.io/blog/everyday-hacks-docker/ #### 13. (Optional) More reading on Docker can be found here: * https://docs.docker.com -* https://docs.docker.com/mac/started/ -* https://docs.docker.com/installation/mac/ +* https://docs.docker.com/get-started/ +* https://docs.docker.com/docker-for-mac/ From 2640f8444d86b7f29e2c9699b33d4c56f6e22c43 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Thu, 26 Jul 2018 15:34:17 -0400 Subject: [PATCH 5/6] Update the ReadMe --- README.md | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c74db8ade78..d2b78eabcdc 100755 --- a/README.md +++ b/README.md @@ -1,14 +1,13 @@ -## Automated testing made fast, easy, and reliable. +## SeleniumBase Automation Framework -
+[![](https://img.shields.io/pypi/v/seleniumbase.svg)](https://pypi.python.org/pypi/seleniumbase) [![Build Status](https://travis-ci.org/seleniumbase/SeleniumBase.svg?branch=master)](https://travis-ci.org/seleniumbase/SeleniumBase) [![Join the chat at https://gitter.im/seleniumbase/SeleniumBase](https://badges.gitter.im/seleniumbase/SeleniumBase.svg)](https://gitter.im/seleniumbase/SeleniumBase?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-[![](https://img.shields.io/pypi/v/seleniumbase.svg)](https://pypi.python.org/pypi/seleniumbase) [![Build Status](https://travis-ci.org/seleniumbase/SeleniumBase.svg?branch=master)](https://travis-ci.org/seleniumbase/SeleniumBase)
+SeleniumBase makes it easy to build & run [Selenium-WebDriver](https://github.com/SeleniumHQ/selenium) automation with [Pytest](https://docs.pytest.org/en/latest/). -SeleniumBase simplifies Web-UI automation by extending Python's unittest framework with WebDriver APIs and intelligent code. - - +**Watch [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) run in [Demo Mode](#seleniumbase_demo_mode):**
+![](https://cdn2.hubspot.net/hubfs/100006/images/sb_demo.gif "SeleniumBase")
### [**Get Started**](#seleniumbase_installation), or Learn More: @@ -30,10 +29,6 @@ pytest my_first_test.py --browser=chrome nosetests my_test_suite.py --browser=firefox ``` -**Watch [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) run in [Demo Mode](#seleniumbase_demo_mode):**
-![](https://cdn2.hubspot.net/hubfs/100006/images/sb_demo.gif "SeleniumBase")
-(If you remove all the asserts from that test, you're left with [basic_script.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/basic_script.py), which performs all the actions you can see when running the test.) - **No more messy code:**
This long line of standard WebDriver code, ```python @@ -150,16 +145,16 @@ nosetests my_first_test.py --browser=firefox (If no browser is specified, Chrome is used by default.) -If the example test is moving too fast for your eyes to see what's going on, you can run it in **Demo Mode** by adding ``--demo_mode`` on the command line, which pauses the browser briefly between actions, and highlights page elements being acted on: +If the example test is moving too fast for your eyes to see what's going on, you can run it in **Demo Mode** by adding ``--demo_mode`` on the command line, which pauses the browser briefly between actions, highlights page elements being acted on, and lets you know what test assertions are happening in real time: ```bash -pytest my_first_test.py --browser=chrome --demo_mode +pytest my_first_test.py --demo_mode ``` You can override the default wait time by either updating [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py) or by using ``--demo_sleep={NUM}`` when using Demo Mode. (NOTE: If you use ``--demo_sleep={NUM}`` without using ``--demo_mode``, nothing will happen.) ```bash -pytest my_first_test.py --browser=chrome --demo_mode --demo_sleep=1.2 +pytest my_first_test.py --demo_mode --demo_sleep=1.2 ``` You can also use the following in your scripts to slow down the tests: From 45cdcad5a3efc97332ab1827e5e2032a856ea7b8 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Thu, 26 Jul 2018 15:35:28 -0400 Subject: [PATCH 6/6] Version 1.12.3 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3a72954e696..4a26d0fcaea 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name='seleniumbase', - version='1.12.2', + version='1.12.3', description='Web Automation & Testing Framework - http://seleniumbase.com', long_description='Web Automation and Testing Framework - seleniumbase.com', platforms='Mac * Windows * Linux * Docker',