karate

Using environment variables in Karate DSL testing

假装没事ソ 提交于 2021-02-07 08:57:24
问题 I'd like to incorporate GitLab CI into my Karate testing. I'd like to loop through my tests with different user names and passwords to ensure our API endpoints are responding correctly to different users. With that in mind, I'd like to be able to store the usernames and passwords as secure environment variables in GitLab (rather than in the karate-config as plain text) and have Karate pull them as needed from either the karate-config or the feature files. Looking through the docs and

Using environment variables in Karate DSL testing

瘦欲@ 提交于 2021-02-07 08:55:31
问题 I'd like to incorporate GitLab CI into my Karate testing. I'd like to loop through my tests with different user names and passwords to ensure our API endpoints are responding correctly to different users. With that in mind, I'd like to be able to store the usernames and passwords as secure environment variables in GitLab (rather than in the karate-config as plain text) and have Karate pull them as needed from either the karate-config or the feature files. Looking through the docs and

No tests run in maven project with karate module

我只是一个虾纸丫 提交于 2021-02-05 11:16:10
问题 We have a multi module project with the following structure module 1 module 2 module e2e parent pom The module e2e contains our karate features (into the src/test/java/features folder) We couldn't figure out how to run the karate tests using the "mvn test". It always runs 0 tests, instead there are some feature files. We have tried running "mvn test" from the root of the project, as well as from inside the e2e module We have other maven projects (not multi module) and it works as expected.

Looking for simple gradle project for Karate automation

故事扮演 提交于 2021-02-05 10:43:09
问题 I am looking for a sample/example gradle project for karate automation. Tried in karate-demo but it didn't helps. Simple skeleton will also helps 回答1: Please refer to this wiki page: https://github.com/intuit/karate/wiki/Gradle plugins { id 'java' } ext { karateVersion = '0.9.5.RC4' } dependencies { testCompile "com.intuit.karate:karate-junit5:${karateVersion}" testCompile "com.intuit.karate:karate-apache:${karateVersion}" } sourceSets { test { resources { srcDir file('src/test/java') exclude

How to store logs for every API call in a separate text file

非 Y 不嫁゛ 提交于 2021-02-05 09:44:39
问题 Using Karate i am making API calls sequentially. I need to store API request and response for this sequential flow of APIs in separate text files for each API call. Need to understand how can i achieve this. I have tried logback which stores entire execution logs in a text file. 回答1: Take a look at karate.prevRequest which will give you the "request". Now use some custom Java (or JS) code and write whatever you want to a file. I think personally it is un-necessary because Karate's HTML report

How to store logs for every API call in a separate text file

北战南征 提交于 2021-02-05 09:44:30
问题 Using Karate i am making API calls sequentially. I need to store API request and response for this sequential flow of APIs in separate text files for each API call. Need to understand how can i achieve this. I have tried logback which stores entire execution logs in a text file. 回答1: Take a look at karate.prevRequest which will give you the "request". Now use some custom Java (or JS) code and write whatever you want to a file. I think personally it is un-necessary because Karate's HTML report

Can we create queue data consumers?

匆匆过客 提交于 2021-02-05 09:12:01
问题 Consider I have rabbitmq or Amazon SQS from which I have to consume the data and validate the same with data in DB. Is it possible to write consumer using karate which simply consumes data from a queue and stores it and validate against the data in DB. 回答1: Yes, using Java interop you can do anything. Refer this example: https://github.com/intuit/karate/tree/master/karate-netty#consumer-provider-example 来源: https://stackoverflow.com/questions/55235142/can-we-create-queue-data-consumers

Karate: Match repeating element in xml

人走茶凉 提交于 2021-02-05 09:12:00
问题 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/>

Can we create queue data consumers?

百般思念 提交于 2021-02-05 09:11:42
问题 Consider I have rabbitmq or Amazon SQS from which I have to consume the data and validate the same with data in DB. Is it possible to write consumer using karate which simply consumes data from a queue and stores it and validate against the data in DB. 回答1: Yes, using Java interop you can do anything. Refer this example: https://github.com/intuit/karate/tree/master/karate-netty#consumer-provider-example 来源: https://stackoverflow.com/questions/55235142/can-we-create-queue-data-consumers

Karate: Match repeating element in xml

半世苍凉 提交于 2021-02-05 09:11:41
问题 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/>