This repository contains implementation of a sample AET Modifier:
AET uses Modifiers to achieve certain conditions before collecting the data (e.g. set browser viewport size or wait for some element to appear). In fact, Modifiers are Collectors which use webdriver to perform some actions, bug simply do not collect any data.
All AET Modifiers implement CollectorJob
interface. To create a Modifier in AET instance, you will need CollectorFactory that provides a new instance of Modifier each time it is required. It also equips Modifier
with WebDriver - so that it can interact with the browser.
You can see the example code in this repository:
More (Java) code examples are in the AET core Modifiers.
.
├── conf
│ └── com.github.aet.modifier.ExampleModifier.cfg
├── features
│ └── kotlin-features.xml
├── misc
│ └── suite.xml
└── src
└── main
├── java
│ └── com
└── kotlin
└── com
confcontains OSGi configuration files for the modifiersfeaturescontains Karaf provisioning configuration file forkotlin-osgi-bundlemisccontains sample suite that can be use to run the test with sample modifierssrccontains code of two sample modifiers:example(written in Java) andanother(written in Kotlin), together with their factories and configs
Choose one of the options:
Choose whether you want to develop a Java or Kotlin version. Hack the modifier's code, rename it do whatever you need using webdriver. Remember to give your modifier a unique name. With that name it will be triggered when AET test collection phase is processed, e.g.
- When you name your component
my-custom-modyou will call it with<my-custom-mod>from the suite (see the<example>in this repo).
Build and deploy it following instructions below.
Run ./gradlew build.
This will produce jar in the build/libs as well as compress the config file to build/distributions.
Run ./setup.sh.
This script will create try-me directory with:
- latest AET Docker Example Swarm
- sample suite with downloaded AET bash client and sample suite
You will have following structure:
├── instance
│ ├── aet-swarm.yml
│ ├── bundles
│ ├── configs
│ ├── features
│ └── report
└── tests
├── aet.sh
└── suite.xml
To deploy example modifier run ./deploy.sh (that will copy the bundle and configs to proper instance directories).
Run the AET instance from the try-me/instance directory using docker stack deploy -c aet-swarm.yml aet.
When the instance is up (see details in the AET Doker instance setup guide) you may run sample suite.
From the tests directory run ./aet.sh http://localhost:8181.
Every time you change the code/config of the custom module, simply run ./deploy.sh and wait a moment for the instance to update (changes are auto-discovered by Karaf).
To see a more detailed description on how to use this modifier template, please refer to this article: