Showing posts with label JUnit. Show all posts
Showing posts with label JUnit. Show all posts

Thursday, May 21, 2015

Technical task. Test automation for web-page.

Recently I was asked about preparing of test-automation for the page http://hh.ru/price.
Major agreement: Java and Selenium.
So I would like to share several steps and ideas how I tried to solved required challenge.
I've created the Maven project to avoid problems with dependency for Selenium:


Adding Selenium dependency

Choose version of Selenium

To solve this task I preferred to show several technics, because adding tests with good architecture should not be difficult thing.

Friday, April 24, 2015

Serenity + JUnit for automation

Several days ago I was asked to complete one technical challenge task.
Task description is to prepare automation for set of settings for e-mail processing.
In details you should automate processing of the following:


One criteria is to use Serenity and JUnit
In this article I would not like to go deeper into tests. I would like to share several steps how I configure my project in Eclipse

Sunday, October 12, 2014

Parametirized test. JUnit. JUnitParams.

I've faced with one very interesting opportunity during experiments with unit testing in Java.
Many thanks to codeabbey for a huge list of interesting tasks that allows me to extend my knowledge about unit testing.
First of all JUnit documentation has a lot of examples how to create parametirized tests. This page contains simple examples that very easy to understand.
But, current implementation of parametirized tests has one disadvantage.
You cannot use different set of parameters for different tests.
For example you implement some specific algorithms for sorting of array and searching for a value inside of array. You would not like separate unit tests to different classes and you want to have several input data sets for both sorting and searching. Or you would like to test behaviour of sort algorithms on Numeric data types and String data types separately. With current realization in JUnit you have no possibility to setup two or more different set of parameters. In other words, you cannot specify set of parameters for each unit test.
After searching in Google, I've found one interesting implementation of such possibility: using JUnitParams extension.
Following several examples can show how to use and how to manipulate with such tests:

  1. Official WiKi page on github.com
  2. Example from old project page code.google.com or new project page on github.com
Project has pom.xml file and can be build from master by Maven. Some corrections still required.
To make successful build for my unit testing I did the following:

  1. Comment following code in pom.xml, to avoid installation gpg on my computer:
  2. Change build version since latest version from master required java-1.8
If you will follow all steps from examples, than all will works fine.
It was very useful for me to find such package and use it in my unit tests.