Also, if you don't have the gradlew file in your current directory:
You can install gradle with homebrew with the following command:
$ brew install gradle
As mentioned in this answer. Then, you are not going to need to include it in your path (homebrew will take care of that) and you can just run (from any directory):
$ gradle test