Code Monkey home page Code Monkey logo

selenium-cucumber-testng-gradle-base-framework's Introduction

IMG JAVA ALLURE License: MIT Build Status GitHub last commit GitHub release (latest by date) GitHub commit activity LinkedIn

Design Pattern: Page Object Model with loadable components(POC) & AAA
Following tools were used in this framework:
Java, Selenium, TestNG, Cucumber, REST Assured, Gradle, Travis CI, Allure Reports, Slack API, SeleniumGrid, WebDriverManager, Faker & MockNeat, BrowserStack, GitHub Pages, and stuff.

ABOUT PROJECT

Project made in my spare time to develop my skills in automation testing.
You don't have to download any WebDrivers - I'm using WebDriverManager, drivers will be downloaded by gradle.
Supported tests executors:

  • Chrome
  • Firefox
  • Opera
  • Safari
  • Edge
  • Internet Explorer
  • SeleniumGrid
  • BrowserStack

FEATURES

  • Support for Allure Report
  • Support for Slack Bot
  • Support for SeleniumGrid
  • Support for Parallel Testing
  • Support for BrowserStack
  • Support for WebDriverManager
  • Support for Fake & Mock data
  • Support for .xlsx files

HOW TO RUN TESTS

There are multiple ways to run tests from this build. It all depends on what do you want to do:

TestNG

  • Right click on TestNG.xml file, and Run -> This will run all tests attached to specific xml runner
  • In terminal type ./gradlew test -> This will run all tests from tests package.(src/test/java/tests)
    You can add some environment settings, before you run tests, e.g:
    • -Dtests.executor="YOUR_HOST_NAME" -> available hosts: Chrome, Firefox, Opera, Safari, Edge, IE, Safari, GRID, BrowserStack
      This is the best option to run tests, all tools, features are working well while running tests via this commend

Cucumber

  • Right click on .feature file, and Run -> This will run .feature file on default settings
  • In terminal type ./gradlew cucumber -> This will run all .feature files on default settings
    You can add some environment settings, before you run tests, e.g:
    • -Dtests.executor="YOUR_HOST_NAME" -> available hosts: Chrome, Firefox, Opera, Safari, Edge, IE, Safari, GRID, BrowserStack
  • In terminal type ./gradlew cucumber -Dcucumber.filter.tags="@YOUR_TAG" -> This will run all .feature scenarios which provided tag
  • Right click on CucumberRunner file, and Run -> This will run all .feature files on default settings
    • This is highly unrecommended option since it's an experimental file and doesn't work well, check build.gradle for more information
  • Create your own runner ๐Ÿ› ๏ธ

TEST RESULTS & TEST LOGS

CI/CD

This is currently configured to run in Github.

Localhost

After each LOCAL cycle run two types of log information are saved inside repository, together with tests results

TestNG & Cucumber

  • Detailed logs in logs directory
  • Colorful logs in testdata.xlsx file
  • Allure HTML report in build/allure-results directory

In terminal type allure generate build/allure-results --clean to generate Allure tests results
Allure tests results available for running tests via: CucumberRunner, ./gradlew test or TestMethod with annotation @Test (src/test/java/tests) Imgur

LOGGER (Slack Bot)

CI/CD

You are able to see real time summary of TestNG suite execution on Slack workspace

Localhost

Not available

FAIL MESSAGE PASS MESSAGE
IMG IMG

SELENIUM GRID (POC)

CI/CD

Not available

Localhost

Right now it's only available for a local host, and it's POC feature, however you are able to check how it works

HOW TO RUN TESTS

  1. Run SeleniumGridRunner
  2. Make sure that SeleniumGrid is running properly, check http://localhost:4444/grid/console
  3. In terminal type ./gradlew test -Dtests.executor=grid -Dremote.browser="YOUR_REMOTE_BROWSER"

TO DO

  1. Add Jenkins CI

AUTHORS

LICENSE

This project is licensed under the MIT License - see the LICENSE.md file for details

selenium-cucumber-testng-gradle-base-framework's People

Contributors

brentgtr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.