Page tree
Skip to end of metadata
Go to start of metadata

We provide you with Native integration into JUnit 4 testing framework.

Getting Started

Integrate to JUnit using 4 simple tests:

  1. Add the manager-client.jar to your project
  2. Add @RunWith annotation
  3. Add Reporter Server URL
  4. Create new ManagerPublisher

    That's it.
    Use the created instance to report tags and files.
    The listener will automatically extract as much data as possible for you.

Capabilities

  • Automatically capture the output, trace, and stacktraces and adds them to the test
  • Add attachments (PDF, HTML reports) to the test
  • Add test tags


Simple Example
import com.experitest.manager.api.ManagerPublisher;
import com.experitest.manager.client.PManager;
import com.experitest.manager.junit.ManagerTestRunner;
import org.junit.*;
import org.junit.rules.TestName;
import org.junit.runner.RunWith;

import java.io.File;

@RunWith(ManagerTestRunner.class)
public class SimpleExampleJUnit {

	static {
    	System.setProperty("manager.url", "localhost:9011");
		System.setProperty("manager.url", "<Cloud url>:<reverse proxy port>/reporter");// in case using Reporter that configure to a single port cloud
		System.setProperty("manager.accesskey", "accesskey"); // in case using Reporter that configure to a cloud 
	}

	private ManagerPublisher managerPublisher = null;

    @Rule
    public TestName testName = new TestName();

    @Before
    public void setup() {

        // Init the managerPublisher in the before section
        managerPublisher = PManager.createManagerPublisher(testName.getMethodName());
    }

    @Test
    public void simpleTest() {

        // Test goes here

        // Add key value tag
        managerPublisher.addProperty("team", "automation");
    }

    @After
    public void tearDown() {

        // Add custom report folder
        managerPublisher.addReportFolder(new File("//path//to//file"));
    }
}