Comments (18)
@ajij-shaikh apologies. the readme is a little confusing. you have to checkout the commit and follow the older readme.md.
let me know if these steps still don't work for you
- git checkout a770a9361396a249456a3f2d5b59ff0a8fab9481
- follow steps in this commits readme to enable reportportal
- uncomment this basically https://github.com/kirksl/karate-maven-gradle/blob/a770a9361396a249456a3f2d5b59ff0a8fab9481/src/test/java/KarateRunner.java#L20
- mvn clean test -Dtest=KarateRunner
from agent-java-karate.
@kirksl works like a charm! 👍 awesome work dude. As I using maven will it be ok if I delete Gradle-related files? Also, this codebase will be usable for karate new version 1.0.1?
from agent-java-karate.
@deepsmittal is this what you were trying to do?
C:\git\test>git clone https://github.com/kirksl/karate-maven-gradle.git
Cloning into 'karate-maven-gradle'...
remote: Enumerating objects: 211, done.
remote: Counting objects: 100% (211/211), done.
remote: Compressing objects: 100% (149/149), done.
Receiving objects: 81% (171/211)sed 152 (delta 44), pack-reused 0 eceiving objects: 58% (123/211)
Receiving objects: 100% (211/211), 106.97 KiB | 1.78 MiB/s, done.
Resolving deltas: 100% (91/91), done.
C:\git\test>cd karate-maven-gradle
C:\git\test\karate-maven-gradle>git checkout a770a9361396a249456a3f2d5b59ff0a8fab9481
Note: switching to 'a770a9361396a249456a3f2d5b59ff0a8fab9481'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at a770a93 java 11 support, default to maven/gradle wrappers, default to auto run without prompting
C:\git\test\karate-maven-gradle>git branch
* (HEAD detached at a770a93)
master
from agent-java-karate.
@ajij-shaikh maybe this will work for you as there is not an agent that works right now.
https://github.com/kirksl/karate-maven-gradle
for 0.9.6 support...
git checkout a770a9361396a249456a3f2d5b59ff0a8fab9481
from agent-java-karate.
@kirksl thanks for your help! I am trying to run the test by starting the spring boot server with the command -
mvn clean test -Dtest=KarateRunner -Dreportportal=true
mvn clean test -Dreportportal=true
on the above code with the valid report portal configuration but not
getting the data in the report portal I am getting other reports such as JUnit, cucumber in the repo
from agent-java-karate.
@ajij-shaikh nice glad it worked. yep blow away gradle then this is just a demo project setup with multiple build systems. git checkout master if you want to use karate 1.0+. had to change a lot but should work too...
from agent-java-karate.
@kirksl When i do git checkout mentioned in above, got following error:
fatal: reference is not a tree: a770a9361396a249456a3f2d5b59ff0a8fab9481
Also i am trying out running report portal with karate 1.0.1 but it is not working out , however i am getting also cucumber, Junit .
from agent-java-karate.
Update: I was successful in sending tests results to Report Portal (I had to use the JKS file ), but for my own project error stills comes for var
HI, @kirksl I am not able to see results in Report Portal .
I followed the process of Cloning the master branch (Karate 1.0.1) and did mvn clean test -Dreportportal=true
The test is running (error) but I don't see results in Report Portal.
I provided the Report portal settings in the file
For My own project (Added the screenshot)
I added KarateHook, RP Reporter files to my own project (Maven project ), and for KarateRunner (I have a similar runner class for my project and in that, I tried adding
Boolean rp = Boolean.parseBoolean(System.getProperty("reportportal", "false"));
var rb = Runner.builder(); ( Var is not getting resolved and if I import it imports from lombok)
if (rp)
{
rb.hook(new KarateHook());
}
@test
public void testParallelDesktop() {
Boolean rp = Boolean.parseBoolean(System.getProperty("reportportal", "false"));
var rb = Runner.builder(); ( Var is not getting resolved and if I import it imports from lombok)
Results results = rb.path("classpath:com")
.outputCucumberJson(true)
.tags("@POSTF&I")
.parallel(0);
if (rp)
{
rb.hook(new KarateHook());
}
generateReport(results.getReportDir());
assertTrue(results.getFailCount() == 0, results.getErrorMessages());
}
My POM file
4.0.0
<groupId>org.example</groupId>
<artifactId>Roadster_POC</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<maven.compiler.version>3.8.1</maven.compiler.version>
<maven.surefire.version>2.22.2</maven.surefire.version>
<karate.version>1.1.0</karate.version>
<extentreport.version>5.0.4</extentreport.version>
<spring.boot.version>1.5.22.RELEASE</spring.boot.version>
</properties>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-epam-reportportal</id>
<name>bintray</name>
<url>http://dl.bintray.com/epam/reportportal</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.boot.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring.boot.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>junit-vintage-engine</artifactId>
<groupId>org.junit.vintage</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.epam.reportportal</groupId>
<artifactId>commons-model</artifactId>
<version>5.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-access</artifactId>
<version>1.2.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback.contrib</groupId>
<artifactId>logback-json-classic</artifactId>
<version>0.1.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback.contrib</groupId>
<artifactId>logback-jackson</artifactId>
<version>0.1.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.12.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.12.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>4.9</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.18</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.epam.reportportal</groupId>
<artifactId>logger-java-logback</artifactId>
<version>5.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-mock-servlet</artifactId>
<version>${karate.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-gatling</artifactId>
<version>${karate.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-robot</artifactId>
<version>${karate.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-junit5</artifactId>
<version>${karate.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>${extentreport.version}</version>
</dependency>
<dependency>
<groupId>net.masterthought</groupId>
<artifactId>cucumber-reporting</artifactId>
<version>3.8.0</version>
<scope>test</scope>
</dependency>
<!-- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>-->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.7.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<testResources>
<testResource>
<directory>src/test/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</testResource>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArgument>-Werror</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<configuration>
<encoding>UTF-8</encoding>
<argLine>-Dfile.encoding=UTF-8</argLine>
<includes>
<include>**/KarateRunner.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
How can I resolve this issue?
Can't we use Plugins in our test runner? and if I want to run through driver runner (How can I use the report portal argument )
from agent-java-karate.
@kirksl When i tried the solution mentioned in master for reportPortal, It is throwing following error :
com.epam.reportportal.exception.InternalReportPortalClientException: Base url for Report Portal server is not set!
Could you please help on this.
from agent-java-karate.
@deepsmittal can you confirm if you've followed these steps in the readme
to enable for karate 1.0:
- install report portal from https://reportportal.io/
- update /src/test/resources/reportportal.properties
- specify jvm arg "-Dreportportal=true" in above commands
from agent-java-karate.
@deepsmittal can you confirm if you've followed these steps in the readme
to enable for karate 1.0:
- install report portal from https://reportportal.io/
- update /src/test/resources/reportportal.properties
- specify jvm arg "-Dreportportal=true" in above commands
Yes @kirksl , i have followed the steps mentioned above.
from agent-java-karate.
@deepsmittal i just pulled the project down from master branch, updated both files in the image attached below and ran the command you see in the console and it worked for me. please try and if you still have trouble please let me know. it sounds like your reportportal is not setup correct in settings possibly.
from agent-java-karate.
from agent-java-karate.
@deepsmittal i just pulled the project down from master branch, updated both files in the image attached below and ran the command you see in the console and it worked for me. please try and if you still have trouble please let me know. it sounds like your reportportal is not setup correct in settings possibly.
Hi @kirksl ,
This worked even for me when i moved reportportal.properties from resources to src/test/java. Thanks for all inputs.
from agent-java-karate.
Hi @kirksl , I am trying to integrate the reportportal with my karate project, Here are the steps that I have followed till now.
I have copied KarateHook.java, KarateRunner.java, RPReporter.java in sr/test/java and also created the reportportal.properties file and updated the credentials there, But When I try to run it It is giving the issue in KarateRunner.java,
cannot find symbol
symbol: class var
location: class KarateRunner
Here you have used var in java file file which is causing the issue,But I don't know what should be the return type there,
How to resolve this or what am I doing wrong here?
from agent-java-karate.
@abhishekagc966gmailcom can you confirm what version of Java you are using. The keyword var
for local type inference was not available until Java 10.
from agent-java-karate.
@kirksl , Currently I am using java 8.
from agent-java-karate.
Please use karate of version 1.3.1
and newer. Earlier versions of Karate are not planned for support.
from agent-java-karate.
Related Issues (18)
- Not able to integrate Report Portal with Karate Framework(API testing) HOT 14
- configure driver is not recognizing karate config variables to parameterize browser name and driver path HOT 1
- Want to show logs in report portal based on log level (WARN, INFO, DEBUG) HOT 2
- Report portal not working with Karate 1.0.1 HOT 2
- Sending Attachments with Karate1.0.1 with Report Portal (Using https://github.com/kirksl/karate-maven-gradle ) HOT 2
- Portal not working with Karate1.2-Junit5 version HOT 1
- Add logging to publishing process HOT 1
- If there is Background and 2 or more tests, if 1 test failed the others are also marked as failed. HOT 10
- How to do parallel execution? HOT 5
- All features in package classpath are reported to reportportal when using tags from command line. HOT 3
- Got an error when running a scenario which called another scenario
- Publish Karate feature tags on Test Suite and Test objects in ReportPortal
- Unable to instantiate report portal client HOT 4
- How to use karate-config.js file with agent-java-karate project HOT 2
- Unable to retrieve the table column value from MS SQL using agent-java-karate HOT 1
- Compilation errors with latest karate versions HOT 6
- karate version 0.9.3 not working with reportPortal HOT 25
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agent-java-karate.