klov icon indicating copy to clipboard operation
klov copied to clipboard

Klov Not attaching to one Reporter?

Open awang101 opened this issue 5 years ago • 2 comments

image

We run tests via parallel in our testNG,

We attempt to connect to method that starts klov/extent reporter via

	public void beforeSuite() {

		synchronized (lock) {
            if (!initialised) {
                startResult();
                initialised = true;
            }
	}

However, we still see Klov being attached to multiple views although they have same report # 3

Best

awang101 avatar Aug 24 '20 18:08 awang101

Basically you want all the parallel run results flushed to a single launch. Let say into launch #1167.. I am also looking for the same

spbrantan avatar Aug 25 '20 12:08 spbrantan

Hi, I got it working similarly as in your code by keeping ExtentReports, ExtentKlovReporter & ExtentSparkReporter static:

private static ExtentReports extent = null;
private static ExtentKlovReporter klovReporter = null;
private static ExtentSparkReporter htmlReporter = null;

and initializing them only once when they are still null:

public synchronized static ExtentReports getReporter() { if (extent == null) extent = new ExtentReports(); return extent; }

filipwoz avatar Jan 26 '21 07:01 filipwoz