emeraldjava/Register Serenity Listener

Created Sat, 22 Jul 2023 20:03:04 +0100 Modified Sun, 28 Apr 2024 08:47:19 +0000
90 Words

Step 1 - Create the Listener

Create a new class which will be the custom listener, eg. MyCustomListener this class must implement StepListener (from the package net.thucidydes.core.steps) and implement all necessary methods and adjust to you own needs.

Step 2 - Regster the Service Locator

1 In the resources folder of the project you are using create a directory META-INF folder 2. Add a file called ’net.thucydides.core.steps.StepListener' 3. Add the Listener class name as the file content.

/META-INF/net.thucydides.core.steps.StepListener
    - a.b.c.MyCustomListener

This allows the ServiceLocator to find and inject the Listener.