
3.7-alpine (based on python:3.7-alpine, Dockerfile).3.8-alpine-selenium (based on python:3.8-alpine with selenium installed, Dockerfile).3.8-alpine (based on python:3.8-alpine, Dockerfile).3.9-alpine-selenium (based on python:3.9-alpine with selenium installed, Dockerfile).3.9-alpine (based on python:3.9-alpine, Dockerfile).
3.6-selenium (based on python:3.6 with selenium installed, Dockerfile).3.7-selenium (based on python:3.7 with selenium installed, Dockerfile).
3.8-selenium (based on python:3.8 with selenium installed, Dockerfile). 3.9-selenium (based on python:3.9 with selenium installed, Dockerfile). 3.9, latest (based on python:3.9, Dockerfile). Apple M1 chip) machines, sevaral issues are found to be blocking (ref #31 #30). Warning: Current versions only support for building and running on amd64 (aka x86-64) machines, for arm64 (e.g. You're now able to fully test your app in any environment, all you need is Docker.$ docker run -it -w /usr/workspace -v $(pwd):/usr/workspace joyzoursky/python-chromedriver:latest bash But you'll be able to test your actual project in real world conditions and have it run automatically, which is pretty much worth it! You'll note that writing E2E tests is quite cumbersome, because you're really just describing step-by-step what's happening. Browser Automationįinally, here's a simple method that automates the sign up process. For context, I do sometimes let the tests run with my local version of Chrome and have the debugger attached, so I'm not using the headless mode there but instead can track the actions. In the test project, I simply check if the containerized Selenium driver should be used and return a RemoteWebDriver instead of a ChromeDriver. I'm using the selenium/standalone-chrome:3.141.59 image and make sure to assign it enough memory, as per the official recommendation. That's pretty great and makes versioning really easy!īuilding on the previous post, you just have to follow these steps: Docker Configuration This means to be able to access an automated browser via Selenium, you just have to spin up a container and connect to it. Luckily, Selenium provides Docker containers with an embedded Chrome and their own RemoteWebDriver. While most who do web development probably have Chrome available, it's a bit of a hassle with testing - you need to make sure that your Selenium version matches the current Chrome version. This worked well, but had one big drawback - when you're executing the tests, you need to have Chrome installed on the build agent or on your local machine. Quickly summarized, you're setting up your environment locally via Docker and then use Seleniums ChromeDriver to automate UI tests for your web application. Last year, I've blogged about automating end-to-end (E2E) tests with an ASP.NET Core application.