Comments (4)
Had a prototype with Object in GlobalWorld, but then you end up with all kind of Double/Float comparison problems.
Do you experience problem with?
Scenario: add highseas demo
Given let variable "intVal" equal to 123
Given request body "{"age":{(age)}}"
{(age)} will be inflated as Java String type, but in the JSON it will end up as number. Since you don't have any quotes for age in the JSON
from cukes.
@AlexeyBuzdin
yes, I agree with you very much. But when using this with DataTable, the table will transfer all the values into string type, take an example as below:
Scenario: prac intVal with dataTable
Given let variable "intVal" equal to "123"
Given request body as below
|val|
|{(intVal)}|
print the request body:
actual is: {"val":"123"}
but I want it as {"val":123}
Have you considered such a scenario with lots of params as below?
Given request body as below
|val1 |val2 |val3 |val4 |val5 |val6 |val7 |val8 |
| {(intVal)} | {(intVal)} |{(intVal)} | {(intVal)} | {(intVal)} | {(intVal)} | {(intVal)} | {(intVal)} |
I try to change source code according by my own requirement with adding some flags as "(int)", but I failed, please give me some good ideas or suggestions, thanks so much.
Given request body as below
|val1 |val2 |val3 |val4 |val5 |val6 |
| {(intVal)}(int) | {(intVal)}(int) |{(intVal)}(int) | {(intVal)}(int) | {(intVal)}(int) | {(intVal)}(int) |
from cukes.
Hi, thanks, that's a valid point, will look into this.
Also maybe Given request body from file /myfile.json
will be a good substitution for you?
You could then put the same {(intVal)}
in the .json file.
Meanwhile feel free to join our Gitter chat for support: https://gitter.im/ctco/cukes-rest?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
from cukes.
Hi @aovercome1234. Investigated the DataTable approach you've proposed and identified a big issue with nested properties there.
If you want to construct a simple json ie { "name": "john"}
then DataTable will work fine. On the other hand if you want to create a nested object `{"name": {"firstname": "john", "lastname": "doe"}} then you'll be limited by Gherkin language. (here's a link to cucumber issue closed by the developers cucumber/cucumber-jvm#442)
So supporting DataTables is a very low priority for cukes-rest since only a small portion of requests can be effectively written in such a way. I will close the issue but will reopen it once/if we decide to support DataTables at all.
But big thanks for bringing this up! If you have any other question on cukes-rest, please don't hesitate to write, would be glad to help.
from cukes.
Related Issues (20)
- support for octet/stream needed
- Add public method to output info in successful steps
- Impossible to use CukesHttpPlugin HOT 4
- HttpLoggingPlugin#parseLogDetails should be case insensitive
- HttpLoggingPlugin#parseLogDetails should be using a List instead of Set, to preserve order in cukes.properties
- How to use "cukes.auth_type" property in cukes.properties?
- If any auth type is used and host connection is refused during any REST call in a scenario, then following scenario is failing with 404 and connection is getting closed
- Support for OAuth HOT 1
- Logs are missing exactly for one of specified Cukes Http log types
- Help on running a POST on a multipart file
- Regex pattern should not be escaped because then length quantifier is escaped
- Fix documentation on configuration page about cukes.profile
- path logging not working HOT 1
- Cukes properties should be overridden by environment variables or else
- Are there any plans to upgrade/migrate to latest Cucumber? HOT 1
- AwaitCondition + HttpRequest + CookieSet plugin = request gets poluted with cookies
- cucumber.publish.quiet=true not working HOT 1
- feature request: parallel execution HOT 1
- Java 17 compatibility
- How use with springboot?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cukes.