diff --git a/README.md b/README.md index 597257c..b4eaebc 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,9 @@ There are two different options for debugging a Flask project: 1. Run `python manage.py runserver` to start a native Flask development server. This comes with the Werkzeug stack-trace debugger, which will present runtime failure stack-traces in-browser with the ability to inspect objects at any point in the trace. For more information, see [Werkzeug documentation](http://werkzeug.pocoo.org/). 2. Run `python manage.py debug` to run a Flask development server with debug exposed, but the native debugger/reloader turned off. This grants access for an IDE to attach itself to the process (i.e. in PyCharm, use `Run` -> `Attach to Local Process`). -Note for Windows users: `gunicorn` is not supported on Windows. You may start the server with `python manage.py run` on your local machine or build and start the Dockerfile. +You can also verify the state of your locally running application using the Selenium UI test script included in the `scripts` directory. + +> **Note for Windows users:** `gunicorn` is not supported on Windows. You may start the server with `python manage.py run` on your local machine or build and start the Dockerfile. #### IBM Cloud Developer Tools diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..68645f7 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,17 @@ +#### Experience Testing + +This application includes a UI test for the application experience written in Python, using Selenium, that you can extend as you further develop your application. + +To run the experience test, first you need to [install Python](https://www.python.org/downloads/) on your system. + +Then install selenium. +```bash +pip install selenium +``` +[Set up the Chrome WebDriver](https://chromedriver.chromium.org/getting-started) on your system, you will also need to install the [Chrome Browser](https://www.google.com/chrome/) if you do not have it. If you prefer, you can update the experience test experience_test.py to use the [Firefox WebDriver](https://developer.mozilla.org/en-US/docs/Web/WebDriver). Make sure that you have added the driver to your system PATH. + +With the application running locally, export the necessary environment variables, and run the Python web experience test in this directory. +```bash +export APP_URL=https://localhost:3000 # default value for the local application +python3 experience_test.py +``` diff --git a/scripts/python_flask.py b/scripts/experience_test.py similarity index 100% rename from scripts/python_flask.py rename to scripts/experience_test.py diff --git a/scripts/experience_test.sh b/scripts/experience_test.sh index 3ac8254..3e0e056 100755 --- a/scripts/experience_test.sh +++ b/scripts/experience_test.sh @@ -15,4 +15,4 @@ echo "Installing Selenium Python package..." pip install selenium echo "Running UI test using Selenium..." -python3 python_flask.py +python3 experience_test.py