This is a tests automation project that consists of two modules
- automated tests written for Open Weather API
- a web tests designed to cover search functionality on wiktionary.org website
- Kotlin - a Next Gen JVM language that makes programming so pleasant process;
- Micronaut framework used in this project for the following reasons:
- dependency injection;
- application configuration properties;
- http client;
- Selenide a handy wrapper around Selenium that brings nicer API and makes tests more reliable;
- JUnit5 for running the tests;
├── tests-api
│ └── src
│ ├── main
│ │ ├── ...
│ └── test
│ └── kotlin
│ └── dev
│ └── serzhshakur
│ └── api
│ └── Test.kt
└── tests-web
└── src
├── main
│ └── ...
└── test
└── kotlin
└── dev
└── serzhshakur
└── web
└── Test.kt
- API tests are located under
tests-api/src/test/kotlin/dev/serzhshakur/api/
- WEB tests are located under
tests-web/src/test/kotlin/dev/serzhshakur/web/
- Linux
- Mac OS
- Windows (haven't tested)
- Chrome
- Firefox
As Micronaut is used in this project you need to enable annotation processing in IntelliJ Idea (look here for more details):
- Go to File > Settings > Build, Execution, Deployment > Compiler > Annotation Processors
- check "Enable annotation processing"
In addition build and tests execution should be delegated to Gradle (look here how to do this).
To run a tests from IntelliJ IDEA
- navigate to a
Test.kt
class - run a separate test or the whole suite. To do that just right click and choose
Run 'Test ...'
You need a valid APPID for Open Weather API. Check here how to get one. In order to globally set your APPID in IntelliJ do the following:
- Run > Edit Configurations > Templates > Gradle
- Add
-DapiToken={your_appid}
to "VM Options"
To run test from command line use the following Gradle command
- API tests
./gradlew clean testApi -DapiToken=[your_appid}
- WEB tests
./gradlew clean testWeb -Dbrowser=chrome -Dheadless=true
-Dheadless
allows to run web tests in headless mode
-Dbrowser
possible values chrome
or firefox
For Windows machines you must run gradlew.bat
instead
This project has integration with travis-ci so each time a new code is pushed to repo a pipeline run on Travis is automatically triggered and the following tests are executed
- Openweather API tests
- Wiktionary WEB tests using Chrome browser
- Wiktionary WEB tests using Firefox browser
The current state of a build is . You can also see the current status at a top of this readme. A stable Chrome version and latest Firefox version in a headless mode are used for running tests on CI.
After tests have been executed you can generate a pretty Allure reports using the following gradle commands:
./gradlew allureReport
./gradlew allureServe
A report will open in your default browser automatically.