Code Monkey home page Code Monkey logo

agent-java-karate's Introduction

ReportPortal runtime Hook for Karate tests

Karate reporters which uploads the results to a ReportPortal server.

DISCLAIMER: We use Google Analytics for sending anonymous usage information such as agent's and client's names, and their versions after a successful launch start. This information might help us to improve both ReportPortal backend and client sides. It is used by the ReportPortal team only and is not supposed for sharing with 3rd parties.

Maven Central CI Build codecov Join Slack chat! stackoverflow Build with Love

The latest version: 5.0.5. Please use Maven Central link above to get the agent.

Overview: How to Add ReportPortal Logging to Your Project

To start using ReportPortal with Karate framework please do the following steps:

  1. Configuration
    • Create/update the reportportal.properties configuration file
    • Build system configuration
    • Add Listener
      • Runtime
      • Post-running
  2. Logging configuration
    • Loggers and their types
  3. Running tests
    • Build system commands

Configuration

'reportportal.properties' configuration file

As the first step you need to create a file named reportportal.properties in your Java project in a source folder src/main/resources or src/test/resources (depending on where your tests are located):

reportportal.properties

rp.endpoint = http://localhost:8080
rp.api.key = test_YIvQraKKSquDZqrA6JLCWCX5qwmMZBk_7tTm_fkN44AHCi18Ze0RtYqxWNYKxk5p
rp.launch = Karate Tests
rp.project = default_personal

Property description

  • rp.endpoint - the URL for the ReportPortal server (actual link).
  • rp.api.key - an access token for ReportPortal which is used for user identification. It can be found on your report portal user profile page.
  • rp.project - a project ID on which the agent will report test launches. Must be set to one of your assigned projects.
  • rp.launch - a user-selected identifier of test launches.

The full list of supported properties is located here in client-java library documentation (a common library for all Java agents): https://github.com/reportportal/client-java

Build system configuration

Maven

If your project is Maven-based you need to add dependencies to pom.xml file:

<project>
    <!-- project declaration omitted -->

    <dependency>
        <groupId>com.epam.reportportal</groupId>
        <artifactId>agent-java-karate</artifactId>
        <version>5.0.5</version>
        <scope>test</scope>
    </dependency>

    <!-- build config omitted -->
</project>

You are free to use you own version of Karate, but not earlier than 1.0.0. If you leave just Agent dependency it will be still OK, it will use transitive Karate version.

Gradle

For Gradle-based projects please update dependencies section in build.gradle file:

dependencies {
    testImplementation 'com.epam.reportportal:agent-java-karate:5.0.5'
}

Listener configuration

Runtime

Runtime publisher uploads Karate tests on ReportPortal during the test execution, providing real-time monitoring capabilities. To publish test results in this case, the test project should use by ReportPortalHook class, an instance of which you should pass to Karate runner. E.G.:

import com.epam.reportportal.karate.ReportPortalHook;
import com.intuit.karate.Runner;

class ScenarioRunnerTest {
	@Test
	void testParallel() {
		return Runner
                .path("classpath:examples")
                .hook(new ReportPortalHook())
                .outputCucumberJson(true)
                .tags("~@ignore")
                .parallel(1);
	}
}

Post-running

Post-running publisher uploads Karate tests on ReportPortal after the test execution. It uses Karate result object to get data about tests. It might be useful if your tests make heavy load both on ReportPortal server or on the running node. To publish test results in this case, the test project should run by KarateReportPortalRunner instead of Karate runner. E.G.:

import com.epam.reportportal.karate.KarateReportPortalRunner;

class ScenarioRunnerTest {
	@Test
	void testParallel() {
		KarateReportPortalRunner
                .path("classpath:examples")
                .outputCucumberJson(true)
                .tags("~@ignore")
                .parallel(1);
	}
}

Logging

Karate uses slf4j as Logging library, so you are free to choose any Logging Framework.

ReportPortal provides its own logger implementations for major logging frameworks like Log4j and Logback. It also provides additional formatting features for popular client and test libraries like: Selenide, Apache HttpComponents, Rest Assured, etc.

Here is the list of supported loggers and setup documentation links.

Logging frameworks:

Library name Documentation link
Log4j https://github.com/reportportal/logger-java-log4j
Logback https://github.com/reportportal/logger-java-logback

HTTP clients:

Library name Documentation link
OkHttp3 https://github.com/reportportal/logger-java-okhttp3
Apache HttpComponents https://github.com/reportportal/logger-java-httpcomponents

Running tests

We are set. To run tests we just need to execute corresponding command in our build system.

Maven

mvn test or mvnw test if you are using Maven wrapper

Gradle

gradle test or gradlew test if you are using Gradle wrapper

agent-java-karate's People

Contributors

filland avatar hardnorth avatar rahul267 avatar raikbitters avatar vitaliirymar avatar vrymar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

agent-java-karate's Issues

If there is Background and 2 or more tests, if 1 test failed the others are also marked as failed.

Describe the bug
In a scenario outline with examples, if 1 example passed and another one failed, the report shows 2 failed tests

Steps to Reproduce
Steps to reproduce the behavior:

  1. Run Scenario Outline with at least 2 Examples where one of them fails.
    E.g.
    Scenario Outline: Verify math
    Given def mathResult = < vara > + < varb >
    Then assert mathResult == < result >

    Examples:
    | vara | varb| result |
    | 2 | 2 | 4 |
    | 1 | 2 | 5 |

  2. Check ReportPortal results

Expected behavior
ReportPortal displays 1 passed test and 1 failed test

Actual behavior
ReportPortal displays 2 failed tests
The passed test is marked as a failed, but without failed steps and without error log inside the steps.

Dependency versions
agent-java-karate 5.0.0

Bug_2_failed_tests_when_1_passed_and_1_failed
Bug_2_failed_tests_when_1_passed_and_1_failed_

Report portal not working with Karate 1.0.1

When i tried using the code , it is not pushing any details to report portal. However when i tried in another framework it worked fine. It would be great help if you could share the steps on how to integrate report portal with Karate 1.0.1 .

thanks in advance.

How to use karate-config.js file with agent-java-karate project

Please note that I installed all the RP dependencies and scripts are working fine.
Thanks for that.
I had another inquiry which is that karate-config.js file is not getting read by the sample project.
I put URL reference of the services in karate-config.js which I am calling through feature file like this
Scenario: create access token
Given url oauth1 + '.uk' + oauth2
And path '/token'
And form field client_id = '***'
And form field client_secret = ''
And form field grant_type = ''
When method post
Then status 200
Where oauth1 & oauth2 are the config value which are present in karate-config.js file.

While running the project I am getting below error:
�[31mjava.lang.RuntimeException: javascript evaluation failed: oauth1 + '.uk' + oauth2
Kindly suggest !

Sending Attachments with Karate1.0.1 with Report Portal (Using https://github.com/kirksl/karate-maven-gradle )

Hi Report Portal,
I wanted to use the report Portal with Karate tool and the integration that is on GitHub is pretty old with the new version of Karate 1.0.1, but I found custom-written Integration with the new version of Karate and it works well.
In that custom version “Attachments aren’t been sent to Report Portal ” My question here is Can we get support How to send Attachments to Report Portal via Karate Integration?
Custom Code for Karate Integration: https://github.com/kirksl/karate-maven-gradle
I have raised an issue there but wanted here support too If there is a way to send attachments

All features in package classpath are reported to reportportal when using tags from command line.

Describe the bug
When using tags from the command line to run Karate tests, all feature files in the package classpath are reported to the report portal. Karate internally filters out the feature files to run and only runs the filtered features and scenarios, but it seems like the report portal karate agent is not able to do so and reports all feature files in the package.

Steps to Reproduce

  1. Use hook to run the test with tags(), so that karate will pick the tags from command line parameters
    Results results = Runner.path("classpath: pathToPackageHavingAllFeatureFiles").hook(new ReportPortalHook()).tags().outputCucumberJson(true).parallel(threadCountValue);

  2. Run test from command line using mvn test command with the tag option like '-Dkarate.options=--tags=@mytag'

Expected behavior
Only tests that karate runs should be reported to ReportPortal.

Actual behavior
All feature files in the classpath package are showing up under the Reportportal launch. The files that are not actually run by Karate are just showing with the status "Run interrupted" and no tests.

Dependency versions
client-java: 5.2.5
agent-java-karate: 5.0.4
karate: 1.4.0

Not able to integrate Report Portal with Karate Framework(API testing)

We are not able to integrate Report Portal with Karate Framework(API testing).
Please suggest options to make it feasible

Note: We have also tried with the below dependency with cucumber but no luck since the runner class is karate (Karate.class) and hence we need options to integrate karate with report portal

com.epam.reportportal agent-java-cucumber 4.0.0

Unable to retrieve the table column value from MS SQL using agent-java-karate

Hi,
I am getting below issue while retrieving the database value using agent-java-karate

12:02:51.937 DEBUG o.s.j.s.JdbcUtils - main - JDBC driver has limited support for JDBC 4.1 'getObject(int, Class)' method
java.sql.SQLException: Conversion not supported for type java.lang.Object
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.result.ResultSetImpl.getObject(ResultSetImpl.java:1475)
at org.springframework.jdbc.support.JdbcUtils.getResultSetValue(JdbcUtils.java:212)
at org.springframework.jdbc.core.SingleColumnRowMapper.getColumnValue(SingleColumnRowMapper.java:149)
at org.springframework.jdbc.core.SingleColumnRowMapper.mapRow(SingleColumnRowMapper.java:114)
at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:94)
at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:61)
at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:439)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:375)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:451)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:461)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:472)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:479)

I use spring framework to get the MSSQL or SQL values and it worked fine with latest karate version 0.9.2 but it is breaking using the agent.

Please suggest further. I am deeply stuck due to this.
@lexecon , @rahul267 , @avarabyeu

Add logging to publishing process

Is your feature request related to a problem? Please describe.
It is difficult to tell what part of the process ReportPortal is currently on.
For example if it is missing UUID , there is no feedback that a uuid is missing. The lib will just fail quietly.

Describe the solution you'd like
Add logs which appear in the pipeline that communicate the current activity and the progress.
eg.

  • ReportPortal has launched
  • ReportPortal is searching for test results
  • ReportPortal is missing UUID
  • ReportPortal 401 error
  • ReportPortal has posted successfully
  • etc

Publish Karate feature tags on Test Suite and Test objects in ReportPortal

Is your feature request related to a problem? Please describe.
Currently I set tags and attributes on the feature level in a feature file. Those tags/details are supposed to be applied to every test defined in that file.

The tags/attributes are published to ReportPortal, but only on the Test Suite level, not on Test level. This causes that a couple of widgets (i.. Component Health Check) cannot be used properly, as i.e. I cannot group test results by attributes - ReportPortal requires that those attributes are set on Test level, not Test Suite level.

Describe the solution you'd like
All tags/attributes which are assigned on Feature level should be set for Test Suite and Test objects.

Describe alternatives you've considered
Alternatively I can copy/paste all tags/attributes to every single test defined in a feature file. This would be a lot of redundant data and madness to maintain.

Additional context
N/A

Got an error when running a scenario which called another scenario

Describe the bug
A clear and concise description of what the bug is.
When I run a scenario which call another scenario, I got below error:

  • call read('@remove-user-then-delete-team') { toDeleteId: '#(toDeleteId)' }
    Cannot invoke "com.epam.reportportal.karate.utils.BlockingConcurrentHashMap$BlockingReference.get(long, java.util.concurrent.TimeUnit)" because the return value of "java.util.Map.remove(Object)" is null

And it runs with no problem after I remove .hook(new ReportPortalHook())

Steps to Reproduce
Steps to reproduce the behavior:

  1. write a test case which will call another scenario
    for example
Scenario: delete a team having members
    # create a team
    * def name = 'team'
    * path 'teams'
    * request { name: "#(name)", description: "auto test"}
    * method post
    * status 200
    * match response.data contains { id: '#string', name: '#(name)', description: 'auto test' }
    * def toDeleteId = response.data.id

    * call read('@remove-user-then-delete-team') { toDeleteId: '#(toDeleteId)' }

@ignore @remove-user-then-delete-team
  Scenario: remove team users and then delete a team
    # get team member
    * path 'teams', toDeleteId, 'members'
    * method get
    * status 200
    * def memberId = response.data.data[0].id

    # remove member
    * path 'teams', toDeleteId, 'members', memberId
    * method delete
    * status 200

    # delete a team
  1. Use hook to run the test

Expected behavior
The test is runned successfully.

Actual behavior
Got an error when running.

  • call read('@remove-user-then-delete-team') { toDeleteId: '#(toDeleteId)' }
    Cannot invoke "com.epam.reportportal.karate.utils.BlockingConcurrentHashMap$BlockingReference.get(long, java.util.concurrent.TimeUnit)" because the return value of "java.util.Map.remove(Object)" is null

Dependency versions
agent-java-karate 5.0.4

Additional context
N/A

How to do parallel execution?

Please, could you inform me how to do parallel execution with KarateReportPortalRunner, so, in karate documentation, it is written not to use the @RunWith when you want to run tests in parallel via CucumberRunner.parallel() ?

Unable to instantiate report portal client

@rahul267
I tried running the maven project which is pointed to master but while running the sample project I am getting the below issue:

Feature: Quote generator
12:01:10.676 ERROR c.e.r.s.ReportPortal - main - Cannot build ReportPortal client
java.net.MalformedURLException: no protocol: yourinstancepleaseedit
at java.base/java.net.URL.(URL.java:627)
at java.base/java.net.URL.(URL.java:523)
at java.base/java.net.URL.(URL.java:470)
at com.epam.reportportal.service.ReportPortal$Builder.defaultClient(ReportPortal.java:274)
at com.epam.reportportal.service.ReportPortal$Builder.build(ReportPortal.java:233)
at com.epam.reportportal.cucumber.AbstractReporter.buildReportPortal(AbstractReporter.java:101)
at com.epam.reportportal.cucumber.AbstractReporter$1.get(AbstractReporter.java:71)
at com.epam.reportportal.cucumber.AbstractReporter$1.get(AbstractReporter.java:64)
at rp.com.google.common.base.Suppliers$MemoizingSupplier.get(Suppliers.java:120)
at com.epam.reportportal.cucumber.ScenarioReporter$1.get(ScenarioReporter.java:60)
at com.epam.reportportal.cucumber.ScenarioReporter$1.get(ScenarioReporter.java:53)
at rp.com.google.common.base.Suppliers$MemoizingSupplier.get(Suppliers.java:120)
at com.epam.reportportal.cucumber.ScenarioReporter.getRootItemId(ScenarioReporter.java:107)
at com.epam.reportportal.cucumber.AbstractReporter.beforeScenario(AbstractReporter.java:149)
at com.epam.reportportal.cucumber.AbstractReporter.startOfScenarioLifeCycle(AbstractReporter.java:322)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at cucumber.runtime.Utils$1.call(Utils.java:40)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:34)
at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:294)
at com.sun.proxy.$Proxy11.startOfScenarioLifeCycle(Unknown Source)
at cucumber.runtime.junit.JUnitReporter.startOfScenarioLifeCycle(JUnitReporter.java:238)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:39)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:102)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at KarateReportPortalRunner.runChild(KarateReportPortalRunner.java:125)
at com.intuit.karate.junit4.Karate.runChild(Karate.java:37)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at com.intuit.karate.junit4.Karate.run(Karate.java:129)
at KarateReportPortalRunner.run(KarateReportPortalRunner.java:130)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Warning: Nashorn engine is planned to be removed from a future JDK release
12:01:12.257 WARN c.i.karate - main - not a js function or feature file: read('classpath:karate-config.js') - [type: NULL, value: null]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by cucumber.deps.com.thoughtworks.xstream.core.util.Fields (file:/Users/cex/.m2/repository/info/cukes/cucumber-jvm-deps/1.0.5/cucumber-jvm-deps-1.0.5.jar) to field java.util.TreeMap.comparator
WARNING: Please consider reporting this to the maintainers of cucumber.deps.com.thoughtworks.xstream.core.util.Fields
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Scenario: Fetch random quote �[90m# feature/Test.feature:2�[0m
�[36mGiven �[0m�[36murl �[0m�[36m�[1m'http://jsonplaceholder.typicode.com/posts'�[0m �[90m# StepDefs.url(String)�[0m
�[36mGiven �[0m�[36mpath '1'�[0m
�[36mWhen �[0m�[36mmethod GET�[0m
�[36mThen �[0m�[36mstatus 200�[0m
12:01:12.760 ERROR c.e.r.s.ReportPortal - main - Cannot build ReportPortal client
java.net.MalformedURLException: no protocol: yourinstancepleaseedit
at java.base/java.net.URL.(URL.java:627)
at java.base/java.net.URL.(URL.java:523)
at java.base/java.net.URL.(URL.java:470)
at com.epam.reportportal.service.ReportPortal$Builder.defaultClient(ReportPortal.java:274)
at com.epam.reportportal.service.ReportPortal$Builder.build(ReportPortal.java:233)
at com.epam.reportportal.cucumber.AbstractReporter.buildReportPortal(AbstractReporter.java:101)
at com.epam.reportportal.cucumber.AbstractReporter$1.get(AbstractReporter.java:71)
at com.epam.reportportal.cucumber.AbstractReporter$1.get(AbstractReporter.java:64)
at rp.com.google.common.base.Suppliers$MemoizingSupplier.get(Suppliers.java:120)
at com.epam.reportportal.cucumber.ScenarioReporter.afterLaunch(ScenarioReporter.java:116)
at com.epam.reportportal.cucumber.AbstractReporter.close(AbstractReporter.java:365)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at cucumber.runtime.Utils$1.call(Utils.java:40)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:34)
at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:294)
at com.sun.proxy.$Proxy11.close(Unknown Source)
at cucumber.runtime.junit.JUnitReporter.close(JUnitReporter.java:232)
at KarateReportPortalRunner.run(KarateReportPortalRunner.java:132)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
com.epam.reportportal.exception.InternalReportPortalClientException: Cannot build ReportPortal client
at com.epam.reportportal.service.ReportPortal$Builder.build(ReportPortal.java:241)
at com.epam.reportportal.cucumber.AbstractReporter.buildReportPortal(AbstractReporter.java:101)
at com.epam.reportportal.cucumber.AbstractReporter$1.get(AbstractReporter.java:71)
at com.epam.reportportal.cucumber.AbstractReporter$1.get(AbstractReporter.java:64)
at rp.com.google.common.base.Suppliers$MemoizingSupplier.get(Suppliers.java:120)
at com.epam.reportportal.cucumber.ScenarioReporter.afterLaunch(ScenarioReporter.java:116)
at com.epam.reportportal.cucumber.AbstractReporter.close(AbstractReporter.java:365)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at cucumber.runtime.Utils$1.call(Utils.java:40)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:34)
at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:294)
at com.sun.proxy.$Proxy11.close(Unknown Source)
at cucumber.runtime.junit.JUnitReporter.close(JUnitReporter.java:232)
at KarateReportPortalRunner.run(KarateReportPortalRunner.java:132)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
Caused by: java.net.MalformedURLException: no protocol: yourinstancepleaseedit
at java.base/java.net.URL.(URL.java:627)
at java.base/java.net.URL.(URL.java:523)
at java.base/java.net.URL.(URL.java:470)
at com.epam.reportportal.service.ReportPortal$Builder.defaultClient(ReportPortal.java:274)
at com.epam.reportportal.service.ReportPortal$Builder.build(ReportPortal.java:233)
... 23 more

Could you please suggest what might be the causing the issue, please ?

Want to show logs in report portal based on log level (WARN, INFO, DEBUG)

Have karate tests integration with report portal setup. Trying to show logs in report portal based on logging configuration level [ fatal>error>warn>info>debug>trace ], but it's not working. It is showing INFO level log under DEBUG section. As per my understanding INFO logs should not logged in DEBUG in report portal, but it showing at wrong place.

Hare is snapshot.
D point to DEBUG log and I pointing to INFO log, Why this INFO logs showing under DEBUG ? Log slider in report portal pointing to INFO in snapshot.
Screenshot (119)

I am using following log4j2.xml

<?xml version="1.0" encoding="UTF-8"?>
<Configuration packages="com.epam.ta.reportportal.log4j.appender" status="WARN">
    <Appenders>
        <Console name="ConsoleAppender" target="SYSTEM_OUT">
            <PatternLayout
                    pattern="%d [%t] %-5level %logger{36} - %msg%n%throwable"/>
        </Console>
        <ReportPortalLog4j2Appender name="ReportPortalAppender">
            <PatternLayout
                    pattern="%d [%t] %-5level %logger{36} - %msg%n%throwable"/>
        </ReportPortalLog4j2Appender>
    </Appenders>
    <Loggers>
        <Root level="DEBUG">
            <AppenderRef ref="ConsoleAppender"/>
            <AppenderRef ref="ReportPortalAppender"/>
        </Root>
        <Logger name="com.epam.reportportal.service" level="WARN" additivity="false">
            <AppenderRef ref="ConsoleAppender"/>
            <AppenderRef ref="ReportPortalAppender"/>
        </Logger>
        <Logger name="com.epam.reportportal.utils" level="WARN" additivity="false">
            <AppenderRef ref="ConsoleAppender"/>
            <AppenderRef ref="ReportPortalAppender"/>
        </Logger>
    </Loggers>
</Configuration>

pom.xml

   <repositories>
		<repository>
			<id>bintray</id>
			<url>http://dl.bintray.com/epam/reportportal</url>
		</repository>
		<repository>
			<id>jitpack.io</id>
			<url>https://jitpack.io</url>
		</repository>
	</repositories>
           
<dependencies>
        <dependency>
            <groupId>com.epam.reportportal</groupId>
            <artifactId>agent-java-cucumber</artifactId>
            <version>5.0.1</version>
        </dependency>
        <dependency>
            <groupId>com.epam.reportportal</groupId>
            <artifactId>commons-model</artifactId>
            <version>5.2.2</version>
        </dependency>
        <dependency>
            <groupId>com.epam.reportportal</groupId>
            <artifactId>client-java</artifactId>
            <version>5.0.21</version>
        </dependency>
    <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-gatling</artifactId>
            <version>0.9.6</version>
        </dependency>
        <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-apache</artifactId>
            <version>0.9.6</version>
        </dependency>
        <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-junit5</artifactId>
            <version>0.9.6</version>
        </dependency>
</dependencies>

I am referring sendLog() methods from https://github.com/workwithprashant/karate-reportportal-demo/blob/develop/src/test/java/com/dell/reporting/reportportal/ScenarioReporter.java

Please suggest any solution for the consolidating logs in report portal as per provided log level.

Thanks,
Shubham

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.