├── .gitignore ├── LICENSE.md ├── .github └── workflows │ └── ci.yaml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # JVM 2 | allure-report/ 3 | build/ 4 | .idea/ 5 | *.iml 6 | .gradle/ 7 | target/ 8 | .kotlin 9 | .gradle 10 | 11 | # Node 12 | node_modules/ 13 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 romsper 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: qa-automation-base 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | tags: 7 | description: 'Tags' 8 | required: true 9 | default: 'regress' 10 | farm: 11 | description: 'Do you need a browser farm?' 12 | required: true 13 | default: 'false' 14 | farm_host: 15 | description: 'SELENOID_HUB_HOST' 16 | required: false 17 | default: 'localhost' 18 | browser: 19 | description: 'Browser name' 20 | required: false 21 | default: 'chrome' 22 | 23 | jobs: 24 | tests: 25 | runs-on: ubuntu-latest 26 | name: Run Tests 27 | steps: 28 | - uses: actions/checkout@v2 29 | 30 | - name: Set up JDK 31 | uses: actions/setup-java@v1 32 | with: 33 | java-version: 1.8 34 | 35 | - name: Set up Maven 36 | uses: stCarolas/setup-maven@v4 37 | with: 38 | maven-version: 3.6.3 39 | 40 | - name: Start Selenoid Server 41 | if: ${{ github.event.inputs.farm }} == 'true' 42 | uses: Xotabu4/selenoid-github-action@v1 43 | 44 | - name: Run test 45 | env: 46 | SELENOID_HUB_HOST: ${{ github.event.inputs.farm_host }} 47 | run: mvn clean test -D TAG=${{ github.event.inputs.tags }} 48 | 49 | - name: Allure history 50 | uses: actions/checkout@v2 51 | if: always() 52 | continue-on-error: true 53 | with: 54 | ref: allure-pages 55 | path: allure-pages 56 | 57 | - name: Create Report 58 | uses: simple-elf/allure-report-action@master 59 | if: always() 60 | id: allure-report 61 | with: 62 | allure_results: target/allure-results 63 | gh_pages: allure-pages 64 | allure_report: allure-report 65 | allure_history: allure-history 66 | 67 | - uses: actions/upload-artifact@v1 68 | if: always() 69 | with: 70 | name: allure-report 71 | path: allure-report 72 | 73 | - name: Deploy report to Github Pages 74 | if: always() 75 | uses: peaceiris/actions-gh-pages@v2 76 | env: 77 | PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }} 78 | PUBLISH_BRANCH: allure-pages 79 | PUBLISH_DIR: allure-history -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Automation project 2 | [![](https://img.shields.io/badge/-LinkedIn-blue?style=flat&logo=Linkedin&logoColor=white)](https://www.linkedin.com/in/romsper/) [![](https://img.shields.io/static/v1?label=Telegram&message=%23&logo=Telegram&color=%23fe8e86)](http://t.me/romsper_qa_buddy) ![](https://komarev.com/ghpvc/?username=romsper) 3 | 4 | ### Description 5 | 6 | This repository contains several examples of **Automation testing** frameworks and projects using different programming languages **Kotlin** and **TypeScript/JavaScript** and tools. You can use these examples as a starting point for your own automation projects or as a reference for best practices in Automation testing. 7 | 8 | ### GitHub Actions 9 | 10 | You can find examples of **GitHub Actions** workflows for running tests in the `.github/workflows` folder. 11 | 12 | ### Kotlin 13 | - [kotlin-retrofit](https://github.com/romsper/qa-automation-bases/tree/kotlin-junit5-retrofit) - Kotlin | Retrofit | Selenide | JDBC | Exposed | JUnit 6 | Allure 14 | - [kotlin-playwright](https://github.com/romsper/qa-automation-base/tree/kotlin-junit5-playwright) - Kotlin | Playwright | JUnit 5 | Allure 15 | - [kotlin-appium](https://github.com/romsper/qa-automation-bases/tree/kotlin-junit5-appium) - Kotlin | Appium with Selenide | JUnit5 | Allure | Allure EE | TestRail 16 | - [kotlin-testng-rest-assured](https://github.com/romsper/qa-automation-bases/tree/kotlin-testng-rest-assured) - Kotlin | Rest-Assured | Selenide | TestNG | Allure 17 | 18 | ### TypeScript/JavaScript 19 | - [ts-playwright](https://github.com/romsper/qa-automation-bases/tree/typescript-playwright-allure) - TypeScript | Playwright | Axios | Allure 20 | - [js-mocha-chai](https://github.com/romsper/qa-automation-bases/tree/js-mocha-chai) - JS | Mocha | Chai | Allure 21 | 22 | #### Frameworks 23 | 24 | [Kotlin](https://kotlinlang.org/docs/reference/) - modern programming language that makes developers happier. It is fully interoperable with Java and is officially supported for Android development. 25 | 26 | [JUnit5](https://junit.org/junit5/docs/current/user-guide/) - one of the most popular testing frameworks for Java/Kotlin projects. You can also try [TestNG](https://testng.org/doc/) if you prefer it more. 27 | 28 | [JUnit6](https://docs.junit.org/current/overview.html) - the next generation of JUnit. It aims to provide a more modern and flexible testing framework for Java/Kotlin projects. 29 | 30 | [Selenide](https://selenide.org/) - powerful framework for UI testing. It is built on top of Selenium WebDriver and provides a simple and concise API for writing stable and maintainable UI tests. 31 | 32 | [Playwright](https://playwright.dev) - modern framework for UI testing that supports multiple browsers and platforms. **Selenide** is more stable and comfortable, but Playwright is more modern and faster. 33 | 34 | [Appium](https://appium.io/) - open-source framework for mobile application testing. It supports both Android and iOS platforms and allows you to write tests using various programming languages, including Kotlin. 35 | 36 | [Retrofit](https://square.github.io/retrofit/) - type-safe HTTP client for Android and Java/Kotlin. It makes it easy to consume RESTful web services. It's much faster and easier than Rest-Assured. Also, you can try [Feign](https://github.com/OpenFeign/feign). 37 | 38 | [Rest-Assured](https://rest-assured.io/) - popular Java/Kotlin library for testing RESTful web services. It provides a simple and intuitive API for making HTTP requests and validating responses. **Retrofit** is a better choice and more modern. 39 | 40 | [Axios](https://axios-http.com/) - promise-based HTTP client for the browser and Node.js. It provides an easy-to-use API for making HTTP requests and handling responses. It's much more modern and better than **Playwright API** requests. 41 | 42 | [Kotest](https://github.com/kotest/kotest) - powerful testing framework for Kotlin with a lot of useful features and integrations. You can use it as an alternative to [AssertJ](https://joel-costigliola.github.io/assertj/). 43 | 44 | [Allure](https://allurereport.org) - flexible lightweight multi-language test report tool with the possibility to integrate with many popular CI services such as Jenkins, TeamCity, GitHub Actions, and others. 45 | 46 | #### Notes 47 | 48 | Almost all tests have `TAGS` annotation that allows you to run specific groups of tests. You can find more information about it in the [User Guide](https://docs.junit.org/current/writing-tests/tagging-and-filtering.html). 49 | 50 | ### Browsers for UI tests 51 | 52 | Recommended to use **Docker** and **Docker-Compose** to run **Selenoid** and **Selenoid-UI** for UI tests. 53 | - [Selenoid and Selenoid-UI](https://aerokube.com/selenoid/latest/#_quick_start) installation guide 54 | 55 | ### Allure Report 56 | 57 | To view the **Allure** report after test execution you need to run the following command in the project root folder: 58 | ```bash 59 | $ allure serve build/allure-results 60 | ``` 61 | or 62 | ```bash 63 | $ allure serve build/allure-results --host localhost --port 9999 64 | ``` 65 | 66 | To generate the **Allure** report without starting a local server use: 67 | ```bash 68 | $ allure generate build/allure-results 69 | ``` 70 | Then open the generated report from the `build/allure-report` folder and click `index.html`. 71 | 72 | ### Allure + Grafana 73 | 74 | You can integrate **Allure** with **Grafana** in order to have a dashboard with historical test results. 75 | 76 | #### How to use it for Grafana: 77 | - Generate **allure-report** by `$ allure generate allure-results` 78 | - Install **InfluxDB** (use **Docker**) 79 | - Get a file for **InfluxDB** in `/allure-report/export/influxDbData.txt` 80 | - Install **Grafana** (use **Docker**) 81 | - Integrate **InfluxDB** to **Grafana** 82 | - Send the report to **InfluxDB** by 83 | - `$ curl -XPOST 'http:///write?db=' --data-binary @allure-report/export/influxDbData.txt` 84 | - Check **Grafana** 85 | - ***PROFIT*** 86 | --------------------------------------------------------------------------------