Skip to content

Commit d05cd59

Browse files
committed
Register Serenity Listener
1 parent dbbfa0e commit d05cd59

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
+++
2+
title = "Register Serenity Listener"
3+
date = 2023-07-22T20:03:04+01:00
4+
author = "emeraldjava"
5+
keywords = ["serenity", "java"]
6+
cover = ""
7+
summary = "Remember the META-INF config for Service Locators"
8+
+++
9+
10+
# Step 1 - Create the Listener
11+
12+
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.
13+
14+
# Step 2 - Regster the Service Locator
15+
16+
1 In the resources folder of the project you are using create a directory META-INF folder
17+
2. Add a file called 'net.thucydides.core.steps.StepListener'
18+
3. Add the Listener class name as the file content.
19+
20+
/META-INF/net.thucydides.core.steps.StepListener
21+
- a.b.c.MyCustomListener
22+
23+
This allows the ServiceLocator to find and inject the Listener.

0 commit comments

Comments
 (0)