Selcukes Notifier
Selcukes Notifier helps to send notifications using Slack and Microsoft Teams.
Motivation
Currently, we moved to On premises environments. To view HTML report generated by automation scripts we need to connect to the different VPN’s to open the report and check the related screenshots to see which test case has failed and why. So, why not raise an alert as soon as the test case fails? And why not attach a screenshot along with that alert so that all the stakeholders can actually see what has failed in the application?
Setup
Selcukes Notifier is primarily used as a Java dependency . We typically use a build tool (such as Maven or Gradle) to resolve the Selcukes Notifier dependency.
- Maven
- Gradle
<dependency>
<groupId>io.github.selcukes</groupId>
<artifactId>selcukes-notifier</artifactId>
<version>${selcukes.version}</version>
</dependency>
dependencies{
implementation("io.github.selcukes:selcukes-notifier:${selcukes.version}")
}
Usage
Add selcukes.yaml
and update below config as follows
notifier:
notification: true
type: teams
webhookToken: WEBHOOKXXXX
apiToken: APIXXXX
channel: selcukes
authorIcon: https://github.com/rameshbabuprudhvi.png
Create a test class as follows
public class NotifierTest {
@Test
public void testNotifications() {
NotifierFactory.getNotifier()
.scenarioName("This is sample scenario")
.scenarioStatus("FAILED")
.stepDetails("This is sample test step")
.errorMessage("NullPointerException")
.path("")
.pushNotification();
}
}