No tests run in maven project with karate module

mvn test behind the scenes just looks for JUnit tests, it is that simple. Check that your JUnit class names end with Test – and that the maven tweak for the recommended directory structure is in place: https://github.com/intuit/karate/issues/724 Otherwise unless you follow this process, it is difficult for anyone to help you: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Karate: Validate a specific date in JSON response

Here you go, one possible solution: * def sdf = new java.text.SimpleDateFormat(“MM-dd-yyyy”) * def today = sdf.format(new java.util.Date()) * def list = $response..createDate * def fun = function(x){ return x.startsWith(today) } * def filtered = karate.filter(list, fun) * assert filtered.size() != 0 For more ideas, see: https://stackoverflow.com/a/55938480/143475 https://stackoverflow.com/a/52892797/143475

How to handle requests with signatures on karate tests?

Karate has a “hook” for generating headers, but as of now it is not “aware” of the currently built request body + headers: https://github.com/intuit/karate#configure-headers We got a similar request here, and are thinking of adding this capability: How to retrieve raw request contents before making a REST call in Karate DSL? Maybe the OAuth examples … Read more

How to rerun failed features in karate?

Here is my reusable implementation using karate-1.0#retry-framework-experimental, Results retryFailedTests(Results results) { System.out.println(“======== Retrying failed tests ========”); Results initialResults = results; List<ScenarioResult> retryResult = results.getScenarioResults().filter(ScenarioResult::isFailed) .parallel() .map(scenarioResult -> initialResults.getSuite().retryScenario(scenarioResult.getScenario())) .collect(Collectors.toList()); for (ScenarioResult scenarioResult : retryResult) { results = results.getSuite().updateResults(scenarioResult); } return results; } This java function takes care of retrying failed scenarios in parallel. You can … Read more

Karate – UI Testing – When using Zalenium Safari and MSEDGE immediately error on driver/session call => no capabilities found [duplicate]

I am using Edge and Safari browsers of Saucelabs through Zalenium as below. Microsoft Edge {type : msedgedriver, webDriverSession : {capabilities : {browserName : MicrosoftEdge}, desiredCapabilities : {browserName : MicrosoftEdge}}, start : false, webDriverUrl : https://username:password@your_zalenium_host.com/wd/hub} Safari {type : safaridriver, webDriverSession : {capabilities : {browserName : safari}, desiredCapabilities : {browserName : safari}}, start : false, … Read more