Code Monkey home page Code Monkey logo

Comments (18)

kirksl avatar kirksl commented on June 20, 2024 1

@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

  1. git checkout a770a9361396a249456a3f2d5b59ff0a8fab9481
  2. follow steps in this commits readme to enable reportportal
  3. uncomment this basically https://github.com/kirksl/karate-maven-gradle/blob/a770a9361396a249456a3f2d5b59ff0a8fab9481/src/test/java/KarateRunner.java#L20
  4. mvn clean test -Dtest=KarateRunner

from agent-java-karate.

ajij-shaikh avatar ajij-shaikh commented on June 20, 2024 1

@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.

kirksl avatar kirksl commented on June 20, 2024 1

@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.

kirksl avatar kirksl commented on June 20, 2024

@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.

ajij-shaikh avatar ajij-shaikh commented on June 20, 2024

@kirksl thanks for your help! I am trying to run the test by starting the spring boot server with the command -

  1. mvn clean test -Dtest=KarateRunner -Dreportportal=true
  2. 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.

kirksl avatar kirksl commented on June 20, 2024

@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.

deepsmittal avatar deepsmittal commented on June 20, 2024

@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.

Shivin89 avatar Shivin89 commented on June 20, 2024

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());
     }

image

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.

deepsmittal avatar deepsmittal commented on June 20, 2024

@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.

kirksl avatar kirksl commented on June 20, 2024

@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 avatar deepsmittal commented on June 20, 2024

@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.

kirksl avatar kirksl commented on June 20, 2024

@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.

image

from agent-java-karate.

Shivin89 avatar Shivin89 commented on June 20, 2024

from agent-java-karate.

deepsmittal avatar deepsmittal commented on June 20, 2024

@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.

image

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.

Related Issues (13)

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.