Skip to content

serzhshakur/qa-automation-micronaut

Repository files navigation

Build status Build Status

Description

This is a tests automation project that consists of two modules

Technology stack

  • 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;

Project structure

├── 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/

Operating systems' support

  • Linux
  • Mac OS
  • Windows (haven't tested)

Supported browsers

  • Chrome
  • Firefox

Tests execution

IntelliJ Idea

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 ...'
APPID for Open Weather API

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"

Command line

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

Travis CI

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 Build Status . 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.

Allure reports

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.

About

Test automation project which includes API and WEB tests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages