connect Karate with selenium - java

I would like to use karate and selenium together. I have read how to call "JavaApiTest class" . To get "JavaApiTest"class working, I added karate -core dependency. If I try to run my tests from cucumber runner then I get the
following error:
java.lang.NoSuchMethodError:
com.intuit.karate.cucumber.CucumberRunner.(Ljava/lang/Class;)V,
So probably the Cucumber runner has conflict with this dependency, if I remove this dependency than CucumberRunner.runFeature and CucumberRunner.runClasspathFeature miss the corresponding jar files.
I have also another question:
How can I run cucumber and karate features at the same time so that the results are summarized in one report.

You can't mix Cucumber and Karate like this, refer this issue: https://github.com/intuit/karate/issues/398
If you are having library conflicts, and you think this is a Karate issue, please follow these instructions: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Related

Gradle Plugin to generate cucumber report not compiling

I am writing Cucumber Automated Test Cases in java, using REST Assured.
All the tests run as JUnit tests, & as Gradle tests, & they all pass successfully.
The next step I need to take is to generate a Cucumber Report based on these test results.
I've been told that I need to find a gradle plugin for cucumber.
So far, I've tried putting the following code (from here: https://plugins.gradle.org/plugin/com.github.spacialcircumstances.gradle-cucumber-reporting) into my build.gradle file:
plugins {
id "com.github.spacialcircumstances.gradle-cucumber-reporting" version "0.0.12"
}
But, when I try to refresh the gradle, I get this error:
Sychrnoize Gradle projects with workspace failed due to an error in the referenced Gradle build.
Is this the correct plugin to generate this cucumber report, and if so, why is it not being accepted by the gradle?

TFS and TestNG - Possible to Execute TestNG test(s) within TFS2015?

TFS and TestNG - Possible to Execute TestNG test(s) within TFS2015?
I have uploaded a Java Maven project to a Repo in my instance of TFS.
My java Maven project comprises of TestNG Test / classes
I can see that there is a Maven plugin within the TFS which also has a JUnit link.
4. I cant see any option to enable me to execute TestNG tests within the TFS, is it even possible?
It's able to use Maven task to build a Java application or test the application including TestNG test. Detail steps please refer this tutorial: Get started testing Java applications with Visual Studio Team Services
For test result report just follow juherr's reply in this question.
Yes you should be able to run your TestNG tests.
I think its eventually going to be Maven that is going to be executing your tests.
Maven makes use of surefire-plugin to basically execute your tests. For TestNG here's two of executing tests via surefire-plugin
If your test matches the default pattern "/Test*.java", "/*Test.java", "**/*TestCase.java" (See here)
Create a suite xml file for TestNG (See here) and have surefire plugin refer to it (see here).

Integrate Spock's test with Sonar

I use spock to write test case and jenkins to run and publish my test cases.
I was able to get the code coverage reported but sonar shows me only Java Unit test cases; the groovy test cases are totally missing
The following pom.xml is used as reference
https://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/spring-standalone-swing/pom.xml
would anyone please know what I am missing ?
Install the Groovy plugin in Sonar. Login as admin/admin and go to
the administration/system/update-center tab
Add the following property in the
pom file
<sonar.tests>src/test/groovy,src/test/java</sonar.tests>
If you do this both Spock and JUnit tests are shown correctly!
See attached screenshot

Cucumber with Gradle for Java

I use Gradle for building my project and I have some trouble between cucumber and gradle. For example:
I have a feature file, which I run with JUnit RunWith annotation. But if I want to run 1 scenario by tag, I write this:
-Dcucumber.options= --tags #1 #2 and try to run it.
But Gradle doesn't see this command and runs all tests. So, how can I correctly apply cucumber plugin into Gradle?
So, I found one way to do it. All we need is to use testCompile with JUnit, not cucumber-junit and all is right.

Can i get maven dependency of Capybara?

I have one rails application. Right now i am using
Parallel_test
gem with Capybara, Cucumber testing framework. Now i am trying to use
Cucumber-JVM
Since previously i have written all my scenario steps in Capybara, so is there any maven dependency of capybara? So that i can use that in my pom file and use existing capybara steps as it is in
Cucumbr-JVM
Please suggest.
No, you can't because there is no port of Capybara to Java. But you can always write your tests in Ruby and than run them from some other Java project. This post explains how to do that.

Categories

Resources