You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* You don't use a JUnit runner, and you write a plain vanilla JUnit test using the `CucumberRunner` in `karate-core`.
346
+
* You don't use a JUnit runner, and you write a plain vanilla JUnit test (it could very well be TestNG or plain old Java) using the `CucumberRunner` in `karate-core`.
347
347
* You can use the returned `KarateStats` to check if any scenarios failed.
348
348
* JUnit XML reports will be generated in `target/surefire-reports/` and CI tools should pick them up automatically.
349
349
* When using Maven, you must disable the JUnit default XML that normally gets generated using `<disableXmlReport>` (refer to the previous section on [test reports](#test-reports)).
350
350
* No other reports will be generated. If you specify a `plugin` option via the `@CucumberOptions` annotation (or the command-line) it will be ignored.
351
+
* Other options passed to `@CucumberOptions` would work as expected, provided you point the `CucumberRunner` to the class having the annotation.
351
352
* For convenience, some stats are logged to the console when execution completes, which should look something like this:
@@ -547,8 +548,9 @@ The following table summmarizes some key differences between Cucumber and Karate
547
548
**More Step Definitions Needed** | **Yes**. You need to keep implementing them as your functionality grows. [This can get very tedious](https://angiejones.tech/rest-assured-with-cucumber-using-bdd-for-web-services-automation#comment-40). | **No**.
548
549
**Layers of Code to Maintain** | **2** Layers. The [Gherkin](https://cucumber.io/docs/reference#gherkin) spec or `*.feature` files make up one layer, and you will also have the corresponding Java step-definitions. | **1** Layer. Only Karate-script (based on Gherkin), and no Java code needs to be implemented.
549
550
**Readable Specification** | **Yes**. Cucumber will read like natural language _if_ you implement the step-definitions right. | **No**. Although Karate is simple, and a [true DSL](https://ayende.com/blog/2984/dsl-vs-fluent-interface-compare-contrast), it is ultimately a mini-programming language. But it is perfect for testing web-services at the level of HTTP requests and responses.
550
-
**Re-Use Feature Files** | **No**. Cucumber does not support being able to call (and thus re-use) other `*.feature` files from a test-script. | [**Yes**](#calling-other-feature-files)
551
+
**Re-Use Feature Files** | **No**. Cucumber does not support being able to call (and thus re-use) other `*.feature` files from a test-script. | [**Yes**](#calling-other-feature-files).
551
552
**Dynamic Data-Driven Testing** | **No**. The [`Scenario Outline:`](#the-cucumber-way) feature of Cucumber expects the `Examples:` to contain a fixed set of rows. | **Yes**. Karate's support for calling other `*.feature` files allows you to use a [JSON array as the data-source](#data-driven-features).
553
+
**Parallel Execution** | **No**. There are various challenges (especially reporting) and you can find [various](https://opencredo.com/test-automation-concepts-parallel-test-execution/)[threads](http://stackoverflow.com/questions/41034116/how-to-execute-cucumber-feature-file-parallel) and third-party [projects](https://github.com/temyers/cucumber-jvm-parallel-plugin) on the internet that attempt to close this gap. | [**Yes**](#parallel-execution).
552
554
**BDD Syntax** | **Yes** | **Yes**
553
555
554
556
One nice thing about the design of the underlying Cucumber framework is that
@@ -569,6 +571,8 @@ You can read more about the Given-When-Then convention at the
569
571
Since Karate is based on Cucumber, you can also employ [data-driven](#data-driven-tests)
570
572
techniques such as expressing data-tables in test scripts.
571
573
574
+
Another good thing that Karate inherits is the nice IDE support for Cucumber that [IntelliJ](https://plugins.jetbrains.com/plugin/7212-cucumber-for-java) and [Eclipse](https://cucumber.io/cucumber-eclipse/) have. So you can do things like right-click and run a `*.feature` file (or scenario) without needing to use a JUnit runner.
575
+
572
576
With the formalities out of the way, let's dive straight into the syntax.
0 commit comments