serenity-reportportal-integration icon indicating copy to clipboard operation
serenity-reportportal-integration copied to clipboard

Add support for GivenStories tag for BDD style tests

Open prasad150 opened this issue 5 years ago • 9 comments

Hi ..

I am using serenity runner with Jbehave BDD . when i try to integrate report portal serenity ,I am getting the below error.Please help me .

prasad150 avatar Nov 06 '19 14:11 prasad150

java.lang.NoSuchMethodError: net.thucydides.core.model.TestOutcome.getTestSource()Ljava/lang/String; at com.github.invictum.reportportal.recorder.TestRecorder.forTest(TestRecorder.java:22) 11623 [pool-1-thread-1] ERROR net.serenitybdd.core.Serenity - TEST FAILED AT STEP Given a scenario with ?DifferentMonth? at com.github.invictum.reportportal.ReportPortalListener.testFinished(ReportPortalListener.java:50) at net.thucydides.core.steps.StepEventBus.testFinished(StepEventBus.java:227) 11623 [pool-1-thread-1] ERROR net.serenitybdd.core.Serenity - at net.serenitybdd.jbehave.SerenityReporter.afterScenario(SerenityReporter.java:544) at org.jbehave.core.reporters.DelegatingStoryReporter.afterScenario(DelegatingStoryReporter.java:43) at org.jbehave.core.reporters.ConcurrentStoryReporter.afterScenario(ConcurrentStoryReporter.java:175) at org.jbehave.core.embedder.StoryRunner.runCancellable(StoryRunner.java:347) at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:239) at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:182) at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:266) at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:233) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

prasad150 avatar Nov 06 '19 14:11 prasad150

@prasad150

Looks like you are trying to use integration with incompatible version of Serenity (possible outdated). Can you specify Serenity version in your project?

Invictum avatar Nov 06 '19 16:11 Invictum

Hi .. Thank you so much for replying back . Yes I observed serenity older version have in my project after upgrading the versions ..It is working fine now.

Another issue identified when you have story ,Inside another story It is giving me this error.

Here is the example.

Scenario: story inside other story GivenStories:apple.story, oranges.story, banana.story Then all fruits verified And End the scenario

java.lang.ArrayIndexOutOfBoundsException: 3 at java.util.concurrent.CopyOnWriteArrayList.get(CopyOnWriteArrayList.java:388) at java.util.concurrent.CopyOnWriteArrayList.get(CopyOnWriteArrayList.java:397) at net.thucydides.core.model.DataTable$RowValueAccessor.toStringMap(DataTable.java:401) at com.github.invictum.reportportal.StartEventBuilder.withParameters(StartEventBuilder.java:44) at com.github.invictum.reportportal.recorder.BddDataDriven.record(BddDataDriven.java:42) at com.github.invictum.reportportal.ReportPortalListener.testFinished(ReportPortalListener.java:51) at net.thucydides.core.steps.StepEventBus.testFinished(StepEventBus.java:303) at net.serenitybdd.jbehave.SerenityReporter.afterScenario(SerenityReporter.java:617) at org.jbehave.core.reporters.DelegatingStoryReporter.afterScenario(DelegatingStoryReporter.java:44) at org.jbehave.core.reporters.ConcurrentStoryReporter.afterScenario(ConcurrentStoryReporter.java:206) at org.jbehave.core.embedder.PerformableTree$PerformableScenario.perform(PerformableTree.java:976) at org.jbehave.core.embedder.PerformableTree$PerformableStory.performScenarios(PerformableTree.java:860) at org.jbehave.core.embedder.PerformableTree$PerformableStory.perform(PerformableTree.java:835) at org.jbehave.core.embedder.PerformableTree.performCancellable(PerformableTree.java:417) at org.jbehave.core.embedder.PerformableTree.perform(PerformableTree.java:388) at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:293) at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

Thanks & Regards, Prasad Nalajarla |+1 972-679-4886.

On Wed, Nov 6, 2019 at 10:53 AM Iaroslav Iershov [email protected] wrote:

@prasad150 https://github.com/prasad150

Looks like you are trying to use integration with incompatible version of Serenity (possible outdated). Can you specify Serenity version in your project?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Invictum/serenity-reportportal-integration/issues/87?email_source=notifications&email_token=ANWJUIBLTQPS6JIZJHCMEWTQSLZBZA5CNFSM4JJWABM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDHHFVQ#issuecomment-550400726, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANWJUID57ITMJPYGI3VTI5LQSLZBZANCNFSM4JJWABMQ .

prasad150 avatar Nov 08 '19 16:11 prasad150

more log details. I have a story to verify all fruits .

Here is the example. verify fruits given.story Scenario:verify fruits given [story inside other storys] GivenStories: apple.story, oranges.story, banana.story Then all fruits verified And End the scenario

java.lang.NullPointerException at com.github.invictum.reportportal.SuiteStorage.lambda$finalizeActive$2(SuiteStorage.java:52) at java.util.concurrent.ConcurrentHashMap$ForEachKeyTask.compute(ConcurrentHashMap.java:4923) at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731) at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:401) at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:734) at java.util.concurrent.ConcurrentHashMap.forEachKey(ConcurrentHashMap.java:3824) at com.github.invictum.reportportal.SuiteStorage.finalizeActive(SuiteStorage.java:50) at com.github.invictum.reportportal.ReportPortalListener.testSuiteFinished(ReportPortalListener.java:38) at net.thucydides.core.steps.StepEventBus.testSuiteFinished(StepEventBus.java:592) at com.swacorp.qmo.SerenityCustomReportingRunner.shutdownTestSuite(SerenityCustomReportingRunner.java:249) at com.swacorp.qmo.SerenityCustomReportingRunner.run(SerenityCustomReportingRunner.java:230) at org.junit.runners.Suite.runChild(Suite.java:127) at org.junit.runners.Suite.runChild(Suite.java:26) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Exception in thread "Thread-1" com.epam.reportportal.exception.ReportPortalException: Report Portal returned error Status code: 406 Status message: Not Acceptable Error Message: Finish launch is not allowed. Launch '5dc96f6869515b0001be3a84' has items '[5dc96f8e69515b0001be3ac1]' with 'IN_PROGRESS' status Error Type: FINISH_LAUNCH_NOT_ALLOWED

at com.epam.reportportal.service.ReportPortalErrorHandler.handleError(ReportPortalErrorHandler.java:83)
at com.epam.reportportal.service.ReportPortalErrorHandler.handle(ReportPortalErrorHandler.java:59)
at com.epam.reportportal.restendpoint.http.HttpClientRestEndpoint$1.subscribe(HttpClientRestEndpoint.java:517)
at io.reactivex.internal.operators.maybe.MaybeCreate.subscribeActual(MaybeCreate.java:45)
at io.reactivex.Maybe.subscribe(Maybe.java:4096)
at io.reactivex.internal.operators.maybe.MaybeCache.subscribeActual(MaybeCache.java:77)
at io.reactivex.Maybe.subscribe(Maybe.java:4096)
at io.reactivex.internal.operators.maybe.MaybeSubscribeOn$SubscribeTask.run(MaybeSubscribeOn.java:54)
at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:38)
at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:26)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

prasad150 avatar Nov 11 '19 14:11 prasad150

@prasad150 Thanks for clarification. I will look into this issue and let you know if I need somethings additional.

Invictum avatar Nov 12 '19 01:11 Invictum

@prasad150 Sorry for late response. Issue occurs because of GivenStories tag that isn't supported for now. I will schedule implementation, but not sure is will be ready in nearest future.

Invictum avatar Nov 25 '19 22:11 Invictum

Thank you for your reply. Please let us know when it is fixed .

On Mon, Nov 25, 2019 at 4:13 PM Iaroslav Iershov [email protected] wrote:

@prasad150 https://github.com/prasad150 Sorry for late response. Issue occurs because ofGivenStories tag that isn't supported for now. I will schedule implementation, but not sure is will be ready in nearest future.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Invictum/serenity-reportportal-integration/issues/87?email_source=notifications&email_token=ANWJUIFRNMINIGGWC5EKZMTQVREZTA5CNFSM4JJWABM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFD7KEY#issuecomment-558363923, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANWJUIHRWB72DMGGLBBLHGDQVREZTANCNFSM4JJWABMQ .

prasad150 avatar Nov 26 '19 16:11 prasad150

Hi, I have integrated report portal with Serenity project(cucumber, Maven) project. I have configured reportportal.properties and repositories mentioned in POM.xml. Serenity report portal integration-1.5.0.jar added as external jar as it is not available in our company. After running the test either it is not throwing any error or it is not connecting to reportportal. Need I to mentioned anything in goal while running the tests?? Could you please help on this ?

false bintray-epam-reportportal bintray https://dl.bintray.com/epam/reportportal

Pom Profile :

		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-enforcer-plugin</artifactId>
			<version>1.4.1</version>
			<executions>
				<execution>
					<id>enforce</id>
					<configuration>
						<rules>
							<requireUpperBoundDeps />
							<requireJavaVersion>
								<version>1.8</version>
							</requireJavaVersion>
						</rules>
					</configuration>
					<goals>
						<goal>enforce</goal>
					</goals>
				</execution>
			</executions>
		</plugin>

		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-surefire-plugin</artifactId>
			<version>2.18</version>
			<configuration>
				<skip>true</skip>
			</configuration>
		</plugin>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-failsafe-plugin</artifactId>
			<version>2.19.1</version>
			<configuration>
				<includes>
					<include>**/*.java</include>
				</includes>
				<parallel>classes</parallel>
				<threadCount>5</threadCount>
				<forkCount>5</forkCount>
			</configuration>
			<executions>
				<execution>
					<goals>
						<goal>integration-test</goal>
						<goal>verify</goal>
					</goals>
				</execution>
			</executions>
		</plugin>

		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-compiler-plugin</artifactId>
			<version>3.2</version>
			<configuration>
				<source>1.8</source>
				<target>1.8</target>
			</configuration>
		</plugin>



		<plugin>
			<groupId>net.serenity-bdd.maven.plugins</groupId>
			<artifactId>serenity-maven-plugin</artifactId>
			<version>${serenity.maven.version}</version>
			<dependencies>
				<dependency>
					<groupId>net.serenity-bdd</groupId>
					<artifactId>serenity-core</artifactId>
					<version>${serenity.version}</version>
				</dependency>
			</dependencies>
			<executions>
				<execution>
					<id>serenity-reports</id>
					<phase>post-integration-test</phase>
					<goals>
						<goal>aggregate</goal>
					</goals>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>

rbetha avatar Jul 09 '20 15:07 rbetha

@Invictum unfortunately, I am also getting the same error. When the tests pass, there is no issue. But when one of the example test fails, the entire execution is stopped and the below error is thrown. Also, there is no GivenStories tag being used. Any help would be greatly appreciated.

Below are the versions and report portal dependency <serenity.version>2.3.11</serenity.version> <serenity.rest.version>2.3.11</serenity.rest.version> <serenity.maven.version>2.4.1</serenity.maven.version> <serenity.cucumber.version>2.3.2</serenity.cucumber.version>

        <artifactId>serenity-reportportal-integration</artifactId>
        <version>1.5.8</version>

11:54:29.827 [pool-2-thread-1] DEBUG n.s.core.photography.Darkroom - Closing darkroom null java.lang.NullPointerException at com.github.invictum.reportportal.SuiteStorage.lambda$finalizeActive$2(SuiteStorage.java:57) at java.base/java.util.concurrent.ConcurrentHashMap$ForEachKeyTask.compute(ConcurrentHashMap.java:4992) at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)

plokeshwar avatar Nov 19 '21 10:11 plokeshwar