flask-webdriver-demo

A minimal blog application in Flask enhanced with Sauce Labs and Travis CI test harness

Stars
8
Committers
2

Flaskr - a minimal blog application with extra Sauce Sauce Test Status Build Status

What is Flaskr?

A sqlite powered thumble blog application based on Flask.

Installation

Clone the repo first

$ git clone [email protected]:christian-bromann/flask-webdriver-demo.git
$ cd flask-webdriver-demo

Virtualenv is probably what you want to use during development, and if you have shell access to your production machines, you’ll probably want to use it there, too.

$ sudo easy_install virtualenv

or

sudo pip install virtualenv

Now, whenever you want to work on a project, you only have to activate the corresponding environment. On OS X and Linux, do the following:

. venv/bin/activate

Then install all requirements:

$ pip install -r requirements.txt

Run app

If you start the application for the first time, you need to initialise the database first:

$ python init_db.py

Run the app by using the Flask CLI

$ flask --app=flaskr run

Run tests

Replace the existing Sauce Labs credentials in the .travis.yml with yours by executing

$ travis encrypt SAUCE_USERNAME=YOUR_USERNAME --add
$ travis encrypt SAUCE_ACCESS_KEY=YOUR_ACCESS_KEY --add

Make sure that your Sauce credentials are available as environment variables in your terminal, run the following command:

echo "export SAUCE_USERNAME=YOUR_USERNAME
export SAUCE_ACCESS_KEY=YOUR_ACCESS_KEY" >> ~/.bash_profile &&
source ~/.bash_profile

Download and run Sauce Connect. After that start the test by executing:

$ ./test.sh