diff --git a/Docker_README.md b/Docker_README.md index bb6be3bd2e6..3837a2c012b 100755 --- a/Docker_README.md +++ b/Docker_README.md @@ -24,19 +24,23 @@ docker run seleniumbase ./run_docker_test_in_firefox.sh -#### 8. You can also enter Docker and stay inside the shell: +#### 8. Now run the same test with Chrome inside your Docker: + + docker run seleniumbase ./run_docker_test_in_chrome.sh + +#### 9. You can also enter Docker and stay inside the shell: docker run -i -t seleniumbase -#### 9. Now you can run the example test from inside the Docker shell: (This time using PhantomJS) +#### 10. Now you can run the example test from inside the Docker shell: (This time with PhantomJS) ./run_docker_test_in_phantomjs.sh -#### 10. When you're satisfied, you may exit the Docker shell: +#### 11. When you're satisfied, you may exit the Docker shell: exit -#### 11. (Optional) Since Docker images and containers take up a lot of space, you may want to clean up your machine from time to time when they’re not being used: +#### 12. (Optional) Since Docker images and containers take up a lot of space, you may want to clean up your machine from time to time when they’re not being used: http://stackoverflow.com/questions/17236796/how-to-remove-old-docker-containers Here are a few of those cleanup commands: @@ -53,7 +57,7 @@ Finally, if you want to wipe out your SeleniumBase Docker virtualbox, use these docker-machine kill seleniumbase docker-machine rm seleniumbase -#### 12. (Optional) More reading on Docker can be found here: +#### 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/ diff --git a/Dockerfile b/Dockerfile index 9620a042549..53ff7732205 100755 --- a/Dockerfile +++ b/Dockerfile @@ -58,6 +58,15 @@ RUN apt-get update -qqy \ && ln -s /opt/firefox/firefox /usr/bin/firefox \ && rm -f /tmp/firefox-esr.tar.bz2 +#================ +# Install Chrome +#================ +RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ + && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list \ + && apt-get update \ + && apt-get install -y google-chrome-stable \ + && rm -rf /var/lib/apt/lists/* + #=================== # Timezone settings #=================== @@ -99,6 +108,7 @@ RUN cd /SeleniumBase && ls && sudo python docker_setup.py install #========================================= COPY docker/docker-entrypoint.sh / COPY docker/run_docker_test_in_firefox.sh / +COPY docker/run_docker_test_in_chrome.sh / COPY docker/run_docker_test_in_phantomjs.sh / COPY docker/docker_config.cfg /SeleniumBase/examples/ ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/docker/ReadMe.md b/docker/ReadMe.md index bb6be3bd2e6..3837a2c012b 100755 --- a/docker/ReadMe.md +++ b/docker/ReadMe.md @@ -24,19 +24,23 @@ docker run seleniumbase ./run_docker_test_in_firefox.sh -#### 8. You can also enter Docker and stay inside the shell: +#### 8. Now run the same test with Chrome inside your Docker: + + docker run seleniumbase ./run_docker_test_in_chrome.sh + +#### 9. You can also enter Docker and stay inside the shell: docker run -i -t seleniumbase -#### 9. Now you can run the example test from inside the Docker shell: (This time using PhantomJS) +#### 10. Now you can run the example test from inside the Docker shell: (This time with PhantomJS) ./run_docker_test_in_phantomjs.sh -#### 10. When you're satisfied, you may exit the Docker shell: +#### 11. When you're satisfied, you may exit the Docker shell: exit -#### 11. (Optional) Since Docker images and containers take up a lot of space, you may want to clean up your machine from time to time when they’re not being used: +#### 12. (Optional) Since Docker images and containers take up a lot of space, you may want to clean up your machine from time to time when they’re not being used: http://stackoverflow.com/questions/17236796/how-to-remove-old-docker-containers Here are a few of those cleanup commands: @@ -53,7 +57,7 @@ Finally, if you want to wipe out your SeleniumBase Docker virtualbox, use these docker-machine kill seleniumbase docker-machine rm seleniumbase -#### 12. (Optional) More reading on Docker can be found here: +#### 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/ diff --git a/docker/run_docker_test_in_chrome.sh b/docker/run_docker_test_in_chrome.sh new file mode 100755 index 00000000000..9f2b4f2308a --- /dev/null +++ b/docker/run_docker_test_in_chrome.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +# Run example test from inside Docker image +echo "Running example SeleniumBase test from Docker with headless Chrome..." +cd /SeleniumBase/examples/ && nosetests my_first_test.py --config=docker_config.cfg --browser=chrome +exec "$@"