kylelhk / Pictionary

CITS5505 Agile Web Development - Group Project
MIT License
1 stars 0 forks source link

Guess That Drawing

CITS5505 Agile Web Development - Group Project

Table of Contents

Purpose

Draw, guess, and chill with friends in a game of wits and sketches!

Architecture

Client-Side (Frontend):

Server-Side (Backend):

Database:

Launch

  1. Clone the repository
git clone https://github.com/kylelhk/Pictionary
  1. Setup virtual environment
python -m venv venv
source venv/bin/activate
  1. Create a .flaskenv environment file to setup environment variables. (Save the file in the same location as .flaskenv.example). Copy the content of .flaskenv.example to .flaskenv.

  2. Download and install the required packages by running the following command


pip install -r requirements.txt
  1. Initialise the database
flask db init
flask db migrate
flask db upgrade

Run this command to add words to draw and guess to the app's database

flask load-data
  1. Run the app
flask run

Enjoy!

Unit Tests

Unit tests are located in the test/unit/ directory.

Setup

Before running the tests, ensure your .flaskenv file contains the following value for the FLASK_APP environment variable:

FLASK_APP="app:create_app('TestConfig')"

Running tests

To run all tests, use the following command:

python -m unittest

For a more detailed output:

python -m unittest -v

To run a specific test class file, use the command:

python -m unittest test.unit.<filename without .py extension>

System Tests

System tests are located in the test/system/ directory.

Setup:

  1. Download ChromeDriver, ensuring that you download the version that matches your installed Chrome version.
  2. Set Chrome and ChromeDriver paths:
    • Change the path to Chrome and ChromeDriver in test/system/test_selenium.py to match your environment.
  3. Ensure the FLASK_APP environment variable is set to the test configuration, as described in the unit tests above.
  4. Ensure the Flask application is running by running the command, flask run.

Running tests

To run the system test, use the following command:

python -m unittest test.system.test_selenium

License

This project is licensed under the MIT license.

Contributors