From 0fa525a97cf4d2427b7b77f64c48c82b3b6aaef9 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Mon, 11 Jan 2016 23:11:37 -0500 Subject: [PATCH 1/3] Install Chrome in Docker machine --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Dockerfile b/Dockerfile index 9620a042549..630620c0834 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 #=================== From 92f71beade4a5845895f13d2e0a311ae07fe5af5 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Mon, 11 Jan 2016 23:12:09 -0500 Subject: [PATCH 2/3] Add script to run test in Chrome from Docker --- Dockerfile | 1 + docker/run_docker_test_in_chrome.sh | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100755 docker/run_docker_test_in_chrome.sh diff --git a/Dockerfile b/Dockerfile index 630620c0834..53ff7732205 100755 --- a/Dockerfile +++ b/Dockerfile @@ -108,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/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 "$@" From 20eda7c0e4f3a01e7190a0d12bafbd0a1af8bf29 Mon Sep 17 00:00:00 2001 From: Michael Mintz Date: Mon, 11 Jan 2016 23:13:52 -0500 Subject: [PATCH 3/3] Update Docker ReadMe files --- Docker_README.md | 14 +++++++++----- docker/ReadMe.md | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) 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/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/