karate

Test suite Run time in karate in report

喜欢而已 提交于 2021-01-27 17:58:49
问题 I am using karate 9.0.0 and running feature files in parallel and generating cucumber report using karate parallel run code. Problem is that in the report in feature overview its showing the total time execution as feature 1 execution time + feature 2 execution time +feature 3 execution time = total execution time but actual execution time is less if i am running features in parallel in more than 1 thread. How can i show and calculate the test suite run time. 回答1: It is reported on the

Karate API - Why response in not returning to called feature file

我怕爱的太早我们不能终老 提交于 2021-01-20 11:35:42
问题 I am calling login feature from another feature under background tag by passing un, pwd and endpoint url like below. Login feature is running successfully but the response of it is not returned to called feature file. @Add Feature: Adding products Background: * table loginDetails | username | password | endPointURL | | 'kUser' | 'kPass' | 'https://qa1.com/shop/login/login' | * def result = call read('Login.feature') loginDetails * print 'Result-'+response * print 'Result-'+result.response

Karate API - Why response in not returning to called feature file

我是研究僧i 提交于 2021-01-20 11:34:56
问题 I am calling login feature from another feature under background tag by passing un, pwd and endpoint url like below. Login feature is running successfully but the response of it is not returned to called feature file. @Add Feature: Adding products Background: * table loginDetails | username | password | endPointURL | | 'kUser' | 'kPass' | 'https://qa1.com/shop/login/login' | * def result = call read('Login.feature') loginDetails * print 'Result-'+response * print 'Result-'+result.response

Karate API - Why response in not returning to called feature file

眉间皱痕 提交于 2021-01-20 11:34:38
问题 I am calling login feature from another feature under background tag by passing un, pwd and endpoint url like below. Login feature is running successfully but the response of it is not returned to called feature file. @Add Feature: Adding products Background: * table loginDetails | username | password | endPointURL | | 'kUser' | 'kPass' | 'https://qa1.com/shop/login/login' | * def result = call read('Login.feature') loginDetails * print 'Result-'+response * print 'Result-'+result.response

Karate: Match repeating element in xml

≡放荡痞女 提交于 2021-01-20 11:24:11
问题 I'm trying to match a repeating element in a xml to karate schema. XML message * def xmlResponse = """ <Envelope> <Header/> <Body> <Response> <Customer> <keys> <primaryKey>1111111</primaryKey> </keys> <simplePay>false</simplePay> </Customer> <serviceGroupList> <serviceGroup> <name>XXXX</name> <count>1</count> <parentName>DDDDD</parentName> <pendingCount>0</pendingCount> <pendingHWSum>0.00</pendingHWSum> </serviceGroup> <serviceGroup> <name>ZZZZZ</name> <count>0</count> <parentName/>

How to handle requests with signatures on karate tests?

你离开我真会死。 提交于 2021-01-20 06:57:37
问题 First of all, thanks for build karate it's a very useful for test API's and UI's. We are using it to test a lot of our endpoints but we would like to know if there is a way or which is the best approach to handle requests with signature as part of the request in the header. In our case we have two headers: ApiKey : this value is always the same Signature : this value depends on the request body content Is there any way to inject the signature value just before the request is executed based on

How to handle requests with signatures on karate tests?

半世苍凉 提交于 2021-01-20 06:57:06
问题 First of all, thanks for build karate it's a very useful for test API's and UI's. We are using it to test a lot of our endpoints but we would like to know if there is a way or which is the best approach to handle requests with signature as part of the request in the header. In our case we have two headers: ApiKey : this value is always the same Signature : this value depends on the request body content Is there any way to inject the signature value just before the request is executed based on

Karate Runner hangs at waiting for parallel features to complete

不打扰是莪最后的温柔 提交于 2021-01-19 02:37:52
问题 I am trying to execute some tests using Karate Runner - @KarateOptions(tags = {"~@ignore"}) //@KarateOptions(features = "examples/test.feature") public class KarateTestRunner { @BeforeClass public static void beforeClass() throws Exception { //TestBase.beforeClass(); } @Test public void testParallel() { Results results = Runner.parallel(getClass(), 5); generateReport(results.getReportDir()); assertTrue(results.getErrorMessages(), results.getFailCount() == 0); } } When I try to execute my

Karate Runner hangs at waiting for parallel features to complete

喜你入骨 提交于 2021-01-19 02:35:07
问题 I am trying to execute some tests using Karate Runner - @KarateOptions(tags = {"~@ignore"}) //@KarateOptions(features = "examples/test.feature") public class KarateTestRunner { @BeforeClass public static void beforeClass() throws Exception { //TestBase.beforeClass(); } @Test public void testParallel() { Results results = Runner.parallel(getClass(), 5); generateReport(results.getReportDir()); assertTrue(results.getErrorMessages(), results.getFailCount() == 0); } } When I try to execute my

How to execute bash script using karate and fail if script fails

僤鯓⒐⒋嵵緔 提交于 2021-01-16 02:43:28
问题 I'm trying to execute bash script using karate. I'm able to execute the script from karate-config.js and also from .feature file. I'm also able to pass the arguments to the script. The problem is, that if the script fails (exits with something else than 0) the test execution continues and finishes as succesfull. I found out that when the script echo-es something then i can access it as a result of the script so I could possibly echo the exit value and do assertion on it (in some re-usable