A demonstration of a web application with tests
This is an application by Coveros to demonstrate good software practices. As we say in agile... Working software over comprehensive documentation ... but that doesn't mean we can't have pretty good documentation too.
gradlew apprun
Demo consists of a simple web application and tests. Its goal is to provide an environment suitable for demonstration and practice in valuable development techniques. Some of the techniques exemplified are:
Its essential goals:
If you want API testing and Selenium testing, you will need to visit these links and download / install the applications found there.
make sure that the Chromedriver executable is installed in one of the directories that is on your path. To see your path, type the following in a command line:
on Windows:
echo %PATH%
On Mac/Linux:
echo $PATH
If you run the command, chromedriver
on the command line, you should get a result similar to this:
Starting ChromeDriver ...
Python can be downloaded here
To run API tests and Selenium tests, an easy way to handle its dependencies is to use pipenv. To get this installed, first download get-pip.py, and run the following on the command line:
python get-pip.py
Then,
pip install pipenv
And in the demo directory,
pipenv install
On the command line, run the following:
On Mac/Linux
./gradlew check
On Windows
gradlew check
On the command line, run the following:
On Mac/Linux
./gradlew apprun
On Windows
gradlew apprun
Then, head to http://localhost:8080/demo
Note: The app has to be already running for these tests to pass, and you need to have installed [Python] and [Chromedriver].
In a new terminal, separate from the one where the server is running, run the following:
On Mac/Linux
./gradlew runAllTests
On Windows
gradlew runAllTests
gradlew coveros - show a cheat sheet of commands for Demo
gradlew apprun - runs the application
gradlew check - runs all tests possible with only dependency being Java 8. No need for app to be running.
gradlew runAllTests - runs the whole set of tests**
gradlew clean - cleans build products and installs pre-push hook. (see the file in this directory, pre-push)
gradlew runBehaveTests - runs the UI tests**
gradlew runApiTests - runs the API tests**
gradlew generateCucumberReport - runs cucumber and creates a nice-looking HTML report
gradlew pitest - runs mutation testing (see http://pitest.org/)
gradlew dependencyCheckAnalyze - analyzes security reports for the dependencies of this project. See https://www.owasp.org/index.php/OWASP_Dependency_Check
gradlew sonarqube - runs static analysis using SonarQube. Sonarqube must be running - check http://localhost:9000
gradlew integrate - runs the database integration tests
gradlew startH2Console - Starts a console to examine the H2 database file. (user and password are empty, URL to use is jdbc:h2:./build/db/training)
gradlew <task 1>...<task N> taskTree - a utility that will show the task tree for a particular task
** Requires the app to be running (usually in another terminal) and all optional dependencies installed.
Details on building out a CI/CD pipeline are found in the "docs/ci_and_cd" directory. For example, to set it all up on a local Windows box