GithubHelp home page GithubHelp logo

agent-java-jbehave's Introduction

Join Slack chat! stackoverflow GitHub contributors Docker Pulls License Build with Love lambdaTest a27c44

Repositories structure

ReportPortal high level architecture

reportportal high level architecture

ReportPortal repositories structure

Report Portal organized into multiple repositories.

ReportPortal server side consists of the following services:

  • service-authorization Authorization Service. In charge of access tokens distribution
  • service-api API Service. Application Backend
  • service-ui UI Service. Application Frontend
  • service-index Index Service. Info and health checks per service.
  • service-analyzer Analyzer Service. Finds most relevant test fail problem.
  • gateway Traefik Gateway Service. Main entry point to application. Port used by gateway should be opened and accessible from outside network.
  • rabbitmq Load balancer for client requests. Bus for messages between servers.
  • minio Attachments storage.

Available plugins developed by ReportPortal team:

Client side adapters related repositories:

  • client-* - API integrations. Http clients, which process HTTP request sending.
  • agent-* - Frameworks integration. Custom reporters/listeners, which monitor test events and trigger event sending via client-*
  • logger-* - Logging integration. Logger appenders, which help to collect logs, bind it with test-case item via agent-* and send to server via client-*

Other repositories stored according to next rules

  • service-* - micro-services which are a part of Application
  • commons-* - common libraries, models, etc., used by micro-services

Installation steps

Simple setup with Docker

It's the best way for demo purposes and small teams. The database is already in the docker-compose.

  1. Install Docker (Engine, Compose)

  2. Download Example of docker-compose descriptor to any folder

  3. Deploy ReportPortal using docker compose plugin within the same folder

docker compose -p reportportal up

To start ReportPortal in daemon mode, add '-d' argument:

docker compose -p reportportal up -d
  1. Open in your browser IP address of deployed environment at port 8080
http://IP_ADDRESS:8080
  1. Use next login\pass for access:
  • default\1q2w3e
  • superadmin\erebus.

Please change admin password for security.

Mentioned compose file deploy all available Bug Tracking System integrations, which not always needed, but use resources.

Production-ready set and Custom deployment with Docker

For production usage, we recommend:

  • choose only required Bug Tracking System integration service. Exclude the rest

To customize deployment and make it production-ready please follow customization steps and details

Integration. How to get log data in

You should add Client Side code inside your test automation. It consists of:

  • client-* - API integrations. Http clients, which process HTTP request sending. E.g. for Java (client-java-*)
  • agent-* - Frameworks integration. Custom reporters/listeners, which monitor test events and trigger event sending via client-*
  • logger-* - Logging integration. Logger appenders, which helps to collect logs, bind it with test-case via agent-* and send to server via client-*

Integration steps and documentation

Contribution

There are many different ways to contribute to Report Portal's development, just find the one that best fits with your skills. Examples of contributions we would love to receive include:

  • Code patches
  • Documentation improvements
  • Translations
  • Bug reports
  • Patch reviews
  • UI enhancements

Big features are also welcome but if you want to see your contributions included in Report Portal codebase we strongly recommend you start by initiating a chat through our Team in Slack.

Contribution details

Documentation

Community / Support

License

Report Portal is Apache 2.0.

agent-java-jbehave's People

Contributors

avarabyeu avatar dzmitrykavalets avatar hardnorth avatar ikalinin1 avatar pbortnik avatar raikbitters avatar scorpibear avatar uarlouski avatar valfirst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

agent-java-jbehave's Issues

IAE when examples table parameter has $ character

java.lang.IllegalArgumentException: No group with name {videoTitle}
	at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1059)
	at java.base/java.util.regex.Matcher.appendReplacement(Matcher.java:997)
	at java.base/java.util.regex.Matcher.replaceAll(Matcher.java:1181)
	at java.base/java.lang.String.replaceAll(String.java:2142)
	at com.epam.reportportal.jbehave.ReportPortalStoryReporter.formatExampleStep(ReportPortalStoryReporter.java:314)
	at com.epam.reportportal.jbehave.ReportPortalStoryReporter.buildStartStepRq(ReportPortalStoryReporter.java:344)
	at com.epam.reportportal.jbehave.ReportPortalScenarioStoryReporter.buildStartStepRq(ReportPortalScenarioStoryReporter.java:77)
	at com.epam.reportportal.jbehave.ReportPortalStoryReporter.startStep(ReportPortalStoryReporter.java:564)
	at com.epam.reportportal.jbehave.ReportPortalStoryReporter.lambda$beforeStep$33(ReportPortalStoryReporter.java:836)
	at java.base/java.util.Optional.map(Optional.java:260)
	at com.epam.reportportal.jbehave.ReportPortalStoryReporter.beforeStep(ReportPortalStoryReporter.java:836)
	at org.vividus.reportportal.jbehave.AdaptedReportPortalStoryReporter.beforeStep(AdaptedReportPortalStoryReporter.java:65)
	at org.jbehave.core.reporters.DelegatingStoryReporter.lambda$beforeStep$18(DelegatingStoryReporter.java:179)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.jbehave.core.reporters.DelegatingStoryReporter.delegate(DelegatingStoryReporter.java:243)

Unable to start launch in ReportPortal com.epam.reportportal.restclient.endpoint.exception.SerializerException: Unable to deserialize content

Facing this issue while runing jbehave stories.

Unable to start launch in ReportPortal
com.epam.reportportal.restclient.endpoint.exception.SerializerException: Unable to deserialize content '{"id":"26c7c5b1-8c2c-4a74-b4b2-8803786b62d0","number":7}' to type 'com.epam.ta.reportportal.ws.model.EntryCreatedRS'
at com.epam.reportportal.restclient.serializer.Jackson2Serializer.deserialize (Jackson2Serializer.java:79)
at com.epam.reportportal.restclient.endpoint.HttpClientRestEndpoint$ClassConverterCallback.callback (HttpClientRestEndpoint.java:403)
at com.epam.reportportal.restclient.endpoint.HttpClientRestEndpoint.executeInternal (HttpClientRestEndpoint.java:345)
at com.epam.reportportal.restclient.endpoint.HttpClientRestEndpoint.post (HttpClientRestEndpoint.java:106)
at com.epam.reportportal.service.ReportPortalService.startLaunch (ReportPortalService.java:91)
at com.epam.reportportal.jbehave.JBehaveUtils.startLaunch (JBehaveUtils.java:106)
at com.epam.reportportal.jbehave.RpJUnitStories.run (RpJUnitStories.java:44)
at com.mastercard.workflow.stories.Stories.run (Stories.java:105)
at org.jbehave.core.embedder.Embedder.runAsEmbeddables (Embedder.java:121)
at org.jbehave.mojo.RunStoriesAsEmbeddables.execute (RunStoriesAsEmbeddables.java:18)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "number" (class com.epam.ta.reportportal.ws.model.EntryCreatedRS), not marked as ignorable (one known property: "id"])
at [Source: (byte[])"{"id":"26c7c5b1-8c2c-4a74-b4b2-8803786b62d0","number":7}"; line: 1, column: 56] (through reference chain: com.epam.ta.reportportal.ws.model.EntryCreatedRS["number"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from (UnrecognizedPropertyException.java:61)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty (DeserializationContext.java:823)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty (StdDeserializer.java:1153)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty (BeanDeserializerBase.java:1589)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla (BeanDeserializerBase.java:1567)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize (BeanDeserializer.java:294)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize (BeanDeserializer.java:151)
at com.fasterxml.jackson.databind.ObjectMapper._readValue (ObjectMapper.java:3984)
at com.fasterxml.jackson.databind.ObjectMapper.readValue (ObjectMapper.java:2276)
at com.fasterxml.jackson.core.JsonParser.readValueAs (JsonParser.java:1729)
at com.epam.reportportal.restclient.serializer.Jackson2Serializer.deserialize (Jackson2Serializer.java:77)
at com.epam.reportportal.restclient.endpoint.HttpClientRestEndpoint$ClassConverterCallback.callback (HttpClientRestEndpoint.java:403)
at com.epam.reportportal.restclient.endpoint.HttpClientRestEndpoint.executeInternal (HttpClientRestEndpoint.java:345)
at com.epam.reportportal.restclient.endpoint.HttpClientRestEndpoint.post (HttpClientRestEndpoint.java:106)
at com.epam.reportportal.service.ReportPortalService.startLaunch (ReportPortalService.java:91)
at com.epam.reportportal.jbehave.JBehaveUtils.startLaunch (JBehaveUtils.java:106)
at com.epam.reportportal.jbehave.RpJUnitStories.run (RpJUnitStories.java:44)
at com.mastercard.workflow.stories.Stories.run (Stories.java:105)
at org.jbehave.core.embedder.Embedder.runAsEmbeddables (Embedder.java:121)
at org.jbehave.mojo.RunStoriesAsEmbeddables.execute (RunStoriesAsEmbeddables.java:18)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)

Using

<dependency> <groupId>com.epam.reportportal</groupId> <artifactId>agent-java-jbehave</artifactId> <version>2.6.1.1-SNAPSHOT</version> </dependency>

Report portal instance up and running. Only result data is not being updated in report portal.

Multithreading support- JBehave Agent

We have configured threads in Jenkin builds. If we execute a build with -Djbehave.execution.threads=4, the results are showing wrong.

Even when the build passes, its showing few scenarios have failed and not showing the correct total scenarios.

First build is with thread=4
Second build is with thread=1

Total Passed Failed
7 4 2 ---> Build1
10 10 ----> Build 2

I am using the latest JBehave agent version 5.1.2

com.epam.reportportal
agent-java-jbehave
5.1.2
Does reportportal supports multithreads

Cannot see logs for JBehave

Cannot see logs for JBehave. Used the sample project provided in the gitHub.

Failed to run batch
org.jbehave.core.embedder.PerformableTree$SomethingHappened@6f584083: java.lang.AssertionError: Widget response doesn't match to the expected one
Generating reports view to 'C:\Users\x219505\Downloads\example-java-jbehave-master (1)\example-java-jbehave-master\target\jbehave' using formats '[stats, console, txt, html, xml, report_portal]' and view properties '{navigator=ftl/jbehave-navigator.ftl, views=ftl/jbehave-views.ftl, reports=ftl/jbehave-reports.ftl, nonDecorated=ftl/jbehave-report-non-decorated.ftl, decorated=ftl/jbehave-report-decorated.ftl, maps=ftl/jbehave-maps.ftl}'
2019-09-24 14:57:18 ERROR - ReportPortal execution error
com.epam.restendpoint.http.exception.SerializerException: Unable to deserialize content
at com.epam.restendpoint.serializer.json.JacksonSerializer.deserialize(JacksonSerializer.java:51)
at com.epam.restendpoint.http.HttpClientRestEndpoint$TypeConverterCallback.callback(HttpClientRestEndpoint.java:644)
at com.epam.restendpoint.http.HttpClientRestEndpoint$1$1.completed(HttpClientRestEndpoint.java:560)
at com.epam.restendpoint.http.HttpClientRestEndpoint$1$1.completed(HttpClientRestEndpoint.java:518)
at rp.org.apache.http.concurrent.BasicFuture.completed(BasicFuture.java:119)
at rp.org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseCompleted(DefaultClientExchangeHandlerImpl.java:177)
at rp.org.apache.http.nio.protocol.HttpAsyncRequestExecutor.processResponse(HttpAsyncRequestExecutor.java:436)
at rp.org.apache.http.nio.protocol.HttpAsyncRequestExecutor.inputReady(HttpAsyncRequestExecutor.java:326)
at rp.org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:265)
at rp.org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
at rp.org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
at rp.org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114)
at rp.org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
at rp.org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
at rp.org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at rp.org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
at rp.org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at rp.org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "number" (class com.epam.ta.reportportal.ws.model.EntryCreatedRS), not marked as ignorable (one known property: "id"])
at [Source: [B@58a3fdd; line: 1, column: 13] (through reference chain: com.epam.ta.reportportal.ws.model.EntryCreatedRS["number"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:62)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:834)
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1093)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1477)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1455)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:282)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3798)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2959)
at com.epam.restendpoint.serializer.json.JacksonSerializer.deserialize(JacksonSerializer.java:49)
... 18 more

pom.xml


4.0.0
simple
test
1.0-SNAPSHOT
JBehave Stories

4.1 3.1.1 1.7.5 **/*Stories.java bintray-epam-reportportal bintray http://dl.bintray.com/epam/reportportal org.jbehave jbehave-core ${jbehave.core.version} com.epam.reportportal agent-java-jbehave 3.0.2
<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-api</artifactId>
  <version>1.7.5</version>
</dependency>

<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-log4j12</artifactId>
  <version>1.7.5</version>
</dependency>
src/main/java true **/*.java src/main/resources true org.apache.maven.plugins maven-compiler-plugin 2.1 1.8 1.8 org.jbehave jbehave-maven-plugin ${jbehave.core.version} unpack-view-resources process-resources unpack-view-resources embeddable-stories integration-test ${embeddables} true false 1 ${meta.filter} run-stories-as-embeddables

JBehave Threads not working

We have configured threads in Jenkin builds. If we execute a build with -Djbehave.execution.threads=4, the results are showing wrong.

Even when the build passes, its showing few scenarios have failed and not showing the correct total scenarios.

First build is with thread=4
Second build is with thread=1

Total Passed Failed
7 4 2
10 10

I am using the latest JBehave agent version 5.1.2

com.epam.reportportal
agent-java-jbehave
5.1.2

Does reportportal supports multithreads

ArrayIndexOutOfBoundEcxeption in retrieveLeaf() of ReportPortalStoryReporter class while running story files in Jbehave

HI, I am working on integration of report portal with my jbehave framework, where I am using ReportPortalScenarioFormat. INSTANCE or ReportPortalStepFormat.INSTANCE
but after running the first scenario successfully , 2nd scenario is getting failed with ArrayIndexOutOfBoundEcxeption in retrieveLeaf() method of ReportPortalStoryReporter class.

Can somebody please help with the cause of this error?

I am using Agent version : agent-java-jbehave 5.0.0 -RC - 2 and Rp version 5.3.5.

I have used guide https://github.com/reportportal/agent-java-jbehave for integration.

Below is the story file structure:
perform card setup of photo credit card device
Narrative:
In order to verify card setup of photo credit card device
As a user
I want to perform card setup of photo credit msr card device

Meta:
@StoryName credit_msr_retail_photo

Scenario: 1.1 To verify Photo Reference number is present in embossing file
Given setting json values in excel for Credit
When user gets card plans from excel for CREDIT_NEW_DEVICE_PHOTO_CARD scenario to onboard Credit product
When user gets card plans from excel for CREDIT_NEW_DEVICE_PHOTO_CARD scenario to onboard Credit product
Then user gets card plans from excel for CREDIT_NEW_DEVICE_PHOTO_CARD scenario to onboard Credit product

Scenario: 1.2 To verify Photo Reference number is present in embossing file
Given user is logged in institution
When user gets card plans from excel for CREDIT_NEW_DEVICE_PHOTO_CARD scenario to onboard Credit product
Then user sign out from customer portal

sendStackTraceToRP throws NullPointerException

sendStackTraceToRP(final Throwable cause) method throws NullPointerException in case if throwable is like this:
failed(step, new Throwable(errorCount + " of soft assertions were failed"));
()
getCause here reryrns null (cause==this)
if (cause != null) {
rq.setMessage(getStackTraceAsString(cause.getCause()));
}
It worked properly in beta

Jbehave agent does not send failure details to RP

Summary
When story failed, agent does not log error details to portal

Prerequisites
Used dependencies:

'com.epam.reportportal:client-java:3.0.3'
'com.epam.reportportal:commons-model:3.0.0'
'com.epam.reportportal:agent-java-jbehave:3.0.0-BETA-2'
'ch.qos.logback:logback-classic:1.2.3'
'ch.qos.logback:logback-core:1.2.3'
'com.epam.reportportal:logger-java-logback:3.0.0'

It seems that code for sending errors is missed in jbehave agent for some reason. For instance, here is code example from testNG agent:

// com.epam.reportportal.testng.BaseTestNGListener
...
    @Override
    public void onTestFailure(ITestResult testResult) {
        testNGService.get().sendReportPortalMsg(testResult);
        testNGService.get().finishTestMethod(Statuses.FAILED, testResult);
    }
...

And identical (I believe) step from jbehave agent:

// com.epam.reportportal.jbehave.ReportPortalStoryReporter
...
	@Override
	public void failed(String step, Throwable cause) {
		JBehaveUtils.finishStep(Statuses.FAILED);
	}
...

and there neither sending errors inside the code.

Remove ReportPortalStepStoryReporter

After year of practice it is time to admit, that Scenario is a Test and Feature is a Suite in plain code terminology. So the ReportPortalStepStoryReporter class provides a complete broken approach and encourage invalid use. We need to remove it.

Show correct test count on ReportPortal without BeforeStory and AfterStory

Dear ReportPortal team,

We use Report Portal as a reporting tool as integration into Vividus and our clients feel uncomfortable to see wrong tests count on ReportPortal. [vividus-agent-reportportal]
image
Can you please remove BeforeStory and AfterStory from test counting or add any kind of configuration to turn it off for a case when BeforeStory and AfterStory are not used in testing.

Vividus team redirected me here.
vividus-framework/vividus#4667

Thanks!

Remove the stacktrace from the log

I am using JBehave agent version 4.0.1. I am using the following code to assert

assertTrue("The following is the list of failures" + errorMessage, success);

So when there is a failure, I would like to see a custom message shown in the log in reportportal.

But when there is a failure, along with the custom message, stack trace is also thrown. I am able to trace the reason for it and it in below give method in com.epam.reportportal.jbehave.JBehaveUtils

public static void sendStackTraceToRP(final Throwable cause) {

	ReportPortal.emitLog(new Function<String, SaveLogRQ>() {
		@Override
		public SaveLogRQ apply(String itemId) {
			SaveLogRQ rq = new SaveLogRQ();
			rq.setTestItemId(itemId);
			rq.setLevel("ERROR");
			rq.setLogTime(Calendar.getInstance().getTime());
			if (cause != null) {
				rq.setMessage(getStackTraceAsString(cause));
			} else {
				rq.setMessage("Test has failed without exception");
			}
			rq.setLogTime(Calendar.getInstance().getTime());

			return rq;
		}
	});
}

Here "getStackTraceAsString", add stack trace along with the custom message. How do I remove the stack trace from this log for better readability.

org.jbehave.core.failures.UUIDExceptionWrapper: Then Compare the Expected values with Actual values for given xpath:
|xpath|expectedvalue|
|/path/text()|Expected Value|
at org.jbehave.core.steps.StepCreator$ParametrisedStep.perform(StepCreator.java:752)
at org.jbehave.core.embedder.PerformableTree$FineSoFar.run(PerformableTree.java:346)
at org.jbehave.core.embedder.PerformableTree$PerformableSteps.perform(PerformableTree.java:1090)
at org.jbehave.core.embedder.PerformableTree$AbstractPerformableScenario.performRestartableSteps(PerformableTree.java:955)
at org.jbehave.core.embedder.PerformableTree$NormalPerformableScenario.perform(PerformableTree.java:994)
at org.jbehave.core.embedder.PerformableTree$PerformableScenario.perform(PerformableTree.java:904)
at org.jbehave.core.embedder.PerformableTree$PerformableStory.performScenarios(PerformableTree.java:825)
at org.jbehave.core.embedder.PerformableTree$PerformableStory.perform(PerformableTree.java:798)
at org.jbehave.core.embedder.PerformableTree.performCancellable(PerformableTree.java:422)
at org.jbehave.core.embedder.PerformableTree.perform(PerformableTree.java:393)
at org.jbehave.core.embedder.StoryManager$EnqueuedStory.call(StoryManager.java:292)
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:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at com.automation.steps.ExtractWorkFlow.throwMangledException(ExtractWorkFlow.java:284)
at com.automation.steps.ExtractWorkFlow.elementsXpathsCompare(ExtractWorkFlow.java:269)
at com.automation.steps.ExtractWorkFlow$$FastClassBySpringCGLIB$$a5d0ab65.invoke()
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at com.automation.steps.ExtractWorkFlow$$EnhancerBySpringCGLIB$$fc879127.elementsXpathsCompare()
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jbehave.core.steps.StepCreator$ParametrisedStep.perform(StepCreator.java:733)
... 15 more

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.