salmaniqbal / flaske2e

Simple python dockerised app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running the website as dokcer container

  1. Run the following command to build the docker image Make sure you are in the web directory

$ docker build -t myapp:1.0 .

  1. Run the following command to run the image

$ docker run -d -p 5000:5000 myapp:1.0

  1. Access the website by navigating to

http://127.0.0.1:5000

Running UI tests

Pre-requsisites

  1. In order to run the UI tests using selenium, install selenium on your machine using the following:

$ pip install -U selenium

  1. Install pytest, instructions are here
  2. More information on Selenium can be found on the official website
  3. 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.

Running the Tests

  1. Ensure that the docker container is running, see instructions in the first section of this file.

  2. 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.

About

Simple python dockerised app


Languages

Language:Python 88.4%Language:HTML 6.5%Language:Dockerfile 5.1%