- Run the following command to build the docker image
Make sure you are in the
web
directory
$ docker build -t myapp:1.0 .
- Run the following command to run the image
$ docker run -d -p 5000:5000 myapp:1.0
- Access the website by navigating to
http://127.0.0.1:5000
- In order to run the UI tests using selenium, install selenium on your machine using the following:
$ pip install -U selenium
- Install pytest, instructions are here
- More information on Selenium can be found on the official website
- These tests use the Chrome web driver to interact with the browser. This driver is included in the repository's root directory and the tests reference it from that location.
-
Ensure that the docker container is running, see instructions in the first section of this file.
-
Go to the root folder and run
$ py.test
This will run the two tests in test_browser.py
& test_flaskapp.py
There are many ways of running selenium UI tests this is one way of doing See the python selenium documentation here for more information.