Insert json data into BDD Feature file - json

We're using Nightwatch version 1.7.13. We are going to retrieve data from a Hazura instance, via a Postman API call or using javascript code in Nightwatch, saving the data to a json file. Is it possible to insert the json data into a Nightwatch BDD feature file?

Related

Apache Spark call to AMADEUS API to display on html

I have an assignement to display flight offers from amadeus api to an html page. In order to do that I need to first edit the json from amadeus with apache spark. How would selecting a date in html call the api to receive json and how would this json be transfered to apache spark in order to be processed? What would be a high level overview of what I am supposed to do ?
I thought to use flask in order to execute a python script to store the json in a folder that is monitored by spark streaming but I don't know if that is a good idea.

Request a specific variable of JSON stream using bash/terminal

I am working with a flutter web server testing. I writing a simple bash script to fetch some JSON data from API request. The API request dispatch following information as JSON response.
{
"code_version":{
"engine_name":"flutter_renderV1",
"proxy":"10.1.1.1:1090",
"test_rate":true,
"test_density":"0.1",
"mapping_eng":"flutter_default_mapper"
},
"developer_info":{
"developerid":"30242",
"context":true,
"request_timestamp":"156122441"
}
}
Once this received, I saved in to local file named server_response{$id}.json. I need to collect test_density value under code_version data frame. I used several awk, sed command to fetch data, unfortunatly I cannot get the exact output from my terminal.
You need to install powerful JSON querying processor like jq processor. you can can easily install from here
once you install jq processor, try following command to extract the variable from JSON key value
suppose, your file named as server_response_123.json,
jq '.code_version.test_density' server_response_123.json
the output will be shown as,
"0.1"

HTTP request from Jira to Logic App not working, but same json from Postman work

I`m trying to build a Logic app on Azure which will receive JSON from Jira and do some magic on the Azure side. I created a button in Jira flow, which will trigger a webhook to Azure App Logic address. In App Logic I had a step called "When HTTP trigger is received". For schema creation I used the JSON from Jira, so the schema should be okay.
The problem is working with the input. In raw file I can see whole JSON with all details and properties, but it's not divided in to variables automatically.
Step output directly from JIRA
Output from Postman
The headers are more or less the same, so that shouldn't be a problem. Without this output I can't work with variables from JSON correctly, because when I will use variables name from Dynamic Menu it will be null (or "")

Azure Logic Apps: Read XML from file and Write a JSON with data

I'm new in it and trying to understand Azure Logic Apps.
I would like to create a LogicApp that:
Looks for new XML-Files
and for each file:
Read the XML
Check if Node "attachment" is present
and for each Attachment:
Read the Filename
Get the File from FTP and do BASE64-encoding
End for each Attachment.
Write JSON File (I have a schema)
DO HTTP-Post to API with JSON file as "application/json"
Is this possible with the Logic-Apps?
Yes, you can.
Check if a node is present, with xpath expression (e.g. xpath(xml(item()),'string(//Part/#ref)'))
For Get File from FTP, use the action FTP - Get File Content
Write JSON File, use the action Data Operations - Compose. If you need transformations, you have to use an Integration Account and Maps.
Do HTTP Post to API, use de action HTTP

How to save API request response in Postman to a JSON file when running a collection

I have set up a collection that executes an API request which its payload is a JSON file.
I would like to run this postman collection for several times using different values for a variable that I have set in my request. However, I don't know how to save the API response from my Get request into a JSON file.
I have done the similar procedure as well for the automation test. Here were some steps I took:
Write a script to execute the postman collection test through postman command line interface modules (https://github.com/postmanlabs/newman), where you can store all the command into a string array with different environment variables you want to specify.
[new man collection -e env_var.json --reporters cli,json --reporter-json-export output.json, new man second run, ... ]
For each execution, you can get the response body by nodejs module and dump the result to json format. (similar to: output responseBody somewhere with newman script from postman collection)
Or you can generate the JSON from newman reporter, and parse the JSON to get the informantion you want.
Hope it helps!