Skip to content

listener output not shown in Jenkins #390

Closed

Description

@idan72

Hi,
I am working with Jenkins plugin 2.28.1.
My tests are with TestNG and I using version 2.13
I add Listener to my testng.xml and create 2 Attachment methods called from onTestFailure
I also add @step for one of the methods called by the test.

In The Execution part I see the Set up and Tear Down part but I dont see the test body.
Also I dont see the output (screenshot and text) from the listener.
The history is also empty.

Thanks

@Override
public void onTestFailure(ITestResult result) {
	saveScreenshotPNG();
	saveText(result.getThrowable().getMessage());
}

@Attachment(value = "Failure Screenshot", type = "image/png")
public byte[] saveScreenshotPNG() {
	TakesScreenshot driver = (TakesScreenshot) GeneralVars.getDriver();
	return driver.getScreenshotAs(OutputType.BYTES);
}

@Attachment(value = "Failure text", type = "text/plain")
public String saveText(String exception) {
	return "Listener " + exception;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions