This gradle plugin helps us to execute and manage ibello tests. To read more about ibello, please visit
https://github.com/kokog78/ibello-api
and
Plugin version: 1.1. Ibello version should greater than or equal to 1.13.0.
In the build.gradle
file, you need to add these lines:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'hu.ibello:ibello-gradle-plugin:1.0'
}
}
apply plugin: 'hu.ibello.gradle'
You have a top-level configuration block for general parameters:
ibello {
installDir file('/path/to/my/ibello/installation')
directory file('/path/to/my/project')
language 'hu'
}
A few words about these parameters:
installDir
: you need to specify a file here which points to the ibello installation directory (where theibello.sh
andibello.cmd
scripts are). You can skip this if you added the ibello to the PATH of your operating system.directory
: you need to specify a file here which points to the ibello project (where theibello
folder is). You can skip this and the plugin will use the current working directory.language
: language code, really optional. If you do not specify it then the default 'en' will be used.
The plugin will add a few tasks to your gradle environment. All of them are in the "ibello" group.
ibelloVersion
: prints the ibello version.ibelloHelp
: prints help about the ibello command line options.ibelloCleanAll
: removes all test results from the project.ibelloUpdateAll
: updates all available webdrivers and removes old ones. If you installed ibello as administrator then you need to have administrative privileges to run this task.ibelloStop
: stops are ongoing test runs and webdrivers. Some CI systems are stopping ibello too forcefully if you manually stops the build process. You can add this task to the end of your continuous integration plan to be sure that no webdrivers are left behind.
Many task types are available in the plugin. Each of them has some common properties:
directory
: same as in the global settings, you just can specify the ibello project for each tasks if you want.argumentsFile
: should be a file, ibello will load it's arguments from this file. You can read more about it in the documentation: https://ibello.eu/documentation-cli.
Here are the task types:
IbelloVersion
: just prints the ibello version.IbelloHelp
: prints the help message.IbelloClean
: removes old test results from the project. It has a parameter:keep
: how many test results you want to keep? The newest ones will survive.
IbelloUpdate
: updates webdrivers. If you installed ibello as administrator then you need to have administrative privileges to run task with this type. It has 2 additional parameters:browser
: the type of the browser, it can be:CHROME
,FIREFOX
,OPERA
,EDGE
. The plugin defines these variable for you. If you do not specify it, all available webdrivers will be updated.remove
: set it totrue
if you want to remove unused webdrivers.
IbelloStop
: stops all tests started from the same ibello directory.IbelloDocgen
: documentation generation with ibello. You can read more about it here: https://ibello.eu/documentation-document-generation. Additional parameters:inputFile
: the input file (as aFile
instance).outputFile
: the output file (as aFile
instance). Optional, if you do not specify it then ibello will find out automatically, and the generated documentation will be in theibello/output
folder.overwrite
: a boolean parameter, you need to specify it if you want to forcefully overwrite existing files.
Examples:
This task removes old test results, only the latest 20 will be available.
task cleanOldResults(type: IbelloClean, group: 'ibello') {
keep 20
}
This task generates documentation:
task generateFancyDocs(type: IbelloDocgen, group: 'ibello') {
inputFile file('ibello/docs/project.json')
overwrite true
}
The tasks below are running tests and they have some extra parameters. These ones:
tags
: list of ibello tags. Read more about tags in the documentation: https://ibello.eu/documentation-configuration.browser
: the type of the browser you want to use. It's value can be:CHROME
,FIREFOX
,OPERA
,EDGE
. The plugin defines these variable for you.headless
: a boolean parameter, if you want to run your tests in headless mode (without a browser window), you need to set it totrue
.size
: default size of the browser window (as a numeric list), for example "1024, 768".repeat
: repeat number of your tests, an integer value.
The task types are:
IbelloRun
: starts a java test. It has one more parameter:java
: you can specify the class/package names of you specifications, for example "*Smoke*". The "*" character is a wildchar.
IbelloCucumber
: starts a cucumber test. It has 2 additional parameters:java
: you can specify the java package name of your glue-code here as a string.featuresDir
: you can specify the directory of your feature files if it is not the default one (thefeatures
subdirectory of you project).
The testing tasks are always using the classpath and dependencies of the current gradle project. If the directory
parameter is specified then only the non-classpath related files (ibello configurations, feature files, test data files, ...) are used from that directory. If there are java classes and other dependencies in that referenced directory then they also should be defined in the current gradle project.
Example:
task mySmokeTestsWithIbello(type: IbelloRun, group: 'ibello') {
java '*Smoke*'
browser CHROME
headless true
tags 'one', 'two', 'three'
}
Dependencies marked with the api
keyword are not used by the tests directly. This is the reason why the ibello-api
dependency - which is provided by the ibello installation - should be added with that keyword to the project. For example:
dependencies {
api 'hu.ibello:ibello-api:1.13.0'
}