Giter Club home page Giter Club logo

hps-java-junit-selenium's Introduction

hps-java-junit + Selenium

Build Status

Hiptest publisher samples with Java/JUnit + Selenium

In this repository you'll find tests generated in Junit format from Hiptest, using Hiptest publisher.

The goals are:

  • to show how tests are exported in JUnit.
  • to check exports work out of the box (well, with implemented actionwords in java)

System under test

The SUT is a (not that much) simple coffee machine. You start it, you ask for a coffee and you get it, sometimes. But most of times you have to add water or beans, empty the grounds. You have an automatic expresso machine at work or at home? So you know how it goes :-)

Update tests

To update the tests:

hiptest-publisher -c junit-selenium.conf --only=tests

The tests are generated in src/test/java/com/coffeemachine/

Run tests locally with Selenium

First, you must use maven to build the project and run the tests:

mvn package

The SUT implementation can be seen in src/web/coffee_machine.js

By default test report is generated in target/surefire-reports/TEST-com.coffeemachine.*.xml

Run tests using Selenium + Cross browser testing

You will first need an account on Cross browser testing. Once this is done, you will need to export a few variables to ensure you are using CrossBrowserTesting driver:

export REMOTE_DRIVER_USERNAME=<your username on Cross Browser Testing>
export REMOTE_DRIVER_PASSWORD=<your access key on Cross Browser Testing>
export REMOTE_DRIVER_URL=hub.crossbrowsertesting.com:80/wd/hub
export USE_REMOTE_DRIVER=true
export USE_CBT=true

You will also need to specify where the system under test is located, for example:

export COFFEE_MACHINE_LOCATION=https://hiptest.github.io/hps-java-junit-selenium/src/web/coffee_machine.html

Run the tests as previously done:

mvn package

This should now use CrossBrowserTesting to run the tests

Run tests using Selenium + SauceLabs

You will first need an account on SauceLabs. Once this is done, you will need to export a few variables to ensure you are using SauceLabs driver:

export REMOTE_DRIVER_USERNAME=<your username on SauceLabs>
export REMOTE_DRIVER_PASSWORD=<your access key on SauceLabs>
export REMOTE_DRIVER_URL=ondemand.saucelabs.com:443/wd/hub
export USE_REMOTE_DRIVER=true
export USE_SAUCELABS=true

You will also need to specify where the system under test is located, for example:

export COFFEE_MACHINE_LOCATION=https://hiptest.github.io/hps-java-junit-selenium/src/web/coffee_machine.html

Run the tests as previously done:

mvn package

This should now use SauceLabs to run the tests

Running tests on Travis-CI

This repository is configured so tests are ran on Travis-CI. There are three environments: local Selenium web driver, SauceLabs and Cross Browser Testing.

If you do not want to run the tests on every plaform, edit the .travis.yml file and remove the environment you do not want to get the tests ran against.

For SauceLabs and CBT, you can not use the REMOTE_DRIVER_USERNAMEand REMOTE_DRIVER_USERNAME variables. Instead, you should set the SAUCELABS_USERNAMEand SAUCELABS_PASSWORD or CBT_USENAMEand CBT_PASSWORD variables, depending on the platform you want to use to run your tests.

Once the build is started, you should see this kind of message in the logs:

Running test on SauceLABS, using account; vincent-psarga
Running test on CBT, using account; vincent%40hiptest.com

If your username does not appear, that means that the variables are not correctly set.

hps-java-junit-selenium's People

Watchers

 avatar  avatar  avatar  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.