Azure test result add - testCaseTitle empty - azure

I am using this documentation to try to publish some test:
https://learn.microsoft.com/en-us/rest/api/azure/devops/test/results/add?view=azure-devops-rest-7.0&tabs=HTTP
https://learn.microsoft.com/en-us/rest/api/azure/devops/test/results/add?view=azure-devops-rest-7.0&tabs=HTTP#examples
This is the body of my request. The results are coming in, but the testCaseTitle is missing.
Is this a BUG or am I missing something?
[
{
"testCaseTitle": "VerifyWebsiteTheme",
"automatedTestName": "FabrikamFiber.WebSite.TestClass.VerifyWebsiteTheme",
"testPlan": "7847",
"priority": 1,
"outcome": "Passed",
"computerName": "my PC",
"errorMessage": "error test",
"durationInMs": 35660
},
{
"testCaseTitle": "VerifyWebsiteLinks",
"automatedTestName": "FabrikamFiber.WebSite.TestClass.VerifyWebsiteLinks",
"priority": 2,
"outcome": "Failed",
"associatedBugs": [
{
"id": 30
}
]
}
]
See attached screenshot:

Related

Amazone Lex: Invalid Lambda Response: Received error response from Lambda: Unhandled

I am new to Lex Platform as well as nodejs and currently using V2 console. Here the task is to create a bot using Lex that will call ServiceNow API and will create and incident by taking details like short description and type of ticket.
The problem is fulfillment done by Lambda function and code used here is Nodejs in which I am not well versed and the person who was working in this has left.
I tried to go through multiple documents and I am not getting any leads.
Then I followed the below link how to log a ticket in servicenow using Lex
https://chatbotslife.com/a-chatbot-for-servicenow-using-amazon-connect-lex-and-lambda-cb7ed7f090b4
However I am stuck with the error.
This is how the code looks like
fulfillment code
fulfillment code
fulfillment code
This is how in console it looks like where it is correctly identifying the intent but then it fails when slot type is included:
lex console
When I checked coludwatch logs this is the event response:
2021-08-19T11:29:21.061Z 7c5a3471-ed64-496a-83ba-fb7dc8d2f233 INFO Received event: {
"sessionId": "21213557437979",
"inputTranscript": "raise an incident",
"interpretations": [
{
"intent": {
"slots": {
"shortDesc": {
"shape": "Scalar",
"value": {
"originalValue": "raise an incident",
"resolvedValues": [
"raise an incident"
],
"interpretedValue": "raise an incident"
}
},
"ticketType": {
"shape": "Scalar",
"value": {
"originalValue": "incident",
"resolvedValues": [
"incident"
],
"interpretedValue": "incident"
}
}
},
"confirmationState": "None",
"name": "LogTicket",
"state": "ReadyForFulfillment"
},
"nluConfidence": 1
},
{
"intent": {
"slots": {},
"confirmationState": "None",
"name": "FallbackIntent",
"state": "ReadyForFulfillment"
}
}
],
"responseContentType": "text/plain; charset=utf-8",
"invocationSource": "FulfillmentCodeHook",
"messageVersion": "1.0",
"sessionState": {
"intent": {
"slots": {
"shortDesc": {
"shape": "Scalar",
"value": {
"originalValue": "raise an incident",
"resolvedValues": [
"raise an incident"
],
"interpretedValue": "raise an incident"
}
},
"ticketType": {
"shape": "Scalar",
"value": {
"originalValue": "incident",
"resolvedValues": [
"incident"
],
"interpretedValue": "incident"
}
}
},
"confirmationState": "None",
"name": "LogTicket",
"state": "ReadyForFulfillment"
},
"originatingRequestId": "a2857e61-32c3-4018-8904-927f3342cf41"
},
"bot": {
"aliasId": "TSTALIASID",
"aliasName": "TestBotAlias",
"name": "TFS-connect-now",
"version": "DRAFT",
"localeId": "en_US",
"id": "VTHO1CRSJN"
},
"inputMode": "Text"
}
And after this it is throwing an error
2021-08-19T11:29:21.062Z 7c5a3471-ed64-496a-83ba-fb7dc8d2f233 ERROR Invoke Error {
"errorType": "TypeError",
"errorMessage": "Cannot read property 'name' of undefined",
"stack": [
"TypeError: Cannot read property 'name' of undefined",
" at Runtime.exports.handler (/var/task/index.js:7:38)",
" at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"
]
}
In chrome network console it shows 424 error.
Any leads how this can be solved ?
the problem is the format of the event. The name of the intention is as follows:
event.sessionState.intent.name
var intent = event.sessionState.intent.name

Node.js: Sending Cucumber JSON results to Jira's Xray - jira-client-xray gives HTTP 405 error

I'm struggling 5th day with sending test results to Jira. Our Jira has latest Xray plugin.
I use Node.js for test automation. I went easiest way to try Xray's capability of swallowing test automation results: 'jira-client-xray' dependency + Cucumber test.
In Jira I have Test Execution (id is KELLO-2426), what includes 1 Test (id is KELLO-2427) with Cucumber steps - Jira_Xray_Auto_Test.PNG.
I have 1 feature file - Feature_file.PNG.
After running the test/feature I got JSON-file with results:
[
{
"keyword": "Feature",
"description": "",
"line": 1,
"name": "Sample Snippets test",
"uri": "Can not be determined",
"tags": [],
"elements": [
{
"keyword": "Scenario",
"description": "",
"name": "open URL",
"tags": [
{
"name": "#KELLO:2426",
"location": {
"line": 6,
"column": 5
}
}
],
"id": "sample-snippets-test;open-url",
"steps": [
{
"arguments": [],
"keyword": "Before",
"name": "Hook",
"result": {
"status": "passed",
"duration": 1301000000
},
"line": "",
"match": {
"location": "can not be determined with webdriver.io"
}
},
{
"arguments": [],
"keyword": "Given",
"name": "the page url is not \"http://webdriverjs.christian-bromann.com/\"",
"result": {
"status": "passed",
"duration": 257000000
},
"line": 8,
"match": {
"location": "can not be determined with webdriver.io"
}
},
{
"arguments": [],
"keyword": "And",
"name": "I open the url \"http://webdriverjs.christian-bromann.com/\"",
"result": {
"status": "passed",
"duration": 1221000000
},
"line": 9,
"match": {
"location": "can not be determined with webdriver.io"
}
},
{
"arguments": [],
"keyword": "Then",
"name": "I expect that the url is \"http://webdriverjs.christian-bromann.com/\"",
"result": {
"status": "passed",
"duration": 244000000
},
"line": 10,
"match": {
"location": "can not be determined with webdriver.io"
}
},
{
"arguments": [],
"keyword": "And",
"name": "I expect that the url is not \"http://google.com\"",
"result": {
"status": "passed",
"duration": 205000000
},
"line": 11,
"match": {
"location": "can not be determined with webdriver.io"
}
},
{
"arguments": [],
"keyword": "After",
"name": "Hook",
"result": {
"status": "passed",
"duration": 186000000
},
"line": "",
"match": {
"location": "can not be determined with webdriver.io"
}
}
]
}
],
"id": "sample-snippets-test",
"metadata": {
"browser": {
"name": "chrome",
"version": "72.0.3626.121"
},
"device": "Device name not known",
"platform": {
"name": "Platform name not known",
"version": "Version not known"
}
}
}
]
Next, I have 'jira.client.xray.js' file, where sending the results is written:
var JiraApiWithXray = require('jira-client-xray');
// Initialize
var jiraXray = new JiraApiWithXray({
strictSSL: false,
protocol: 'https',
username: 'your_username',
password: 'your_password',
host: 'your_host',
apiVersion: '1.0' //Check version from DevTools -> Network tab
});
const testExecResults = './results/sample-snippets-test.1574077621820.json';
try {
jiraXray.importExecResultsFromCucumber(testExecResults).then(function (testExecIssueId) {});
} catch(ex) {
console.log('Error:');
console.log(ex);
}
Initiating delivery of the test results by command node jira.client.xray.js from projects root directory gives me the following error:
UnhandledPromiseRejectionWarning: StatusCodeError: 405 - undefined
What is wrong? Suggest me please.
Yours sincerely,
JS comrade
Here shows the error you are receiving
https://restfulapi.net/http-status-codes/
That would lead me to believe it is a problem with your request being sent. My initial thoughts are testExecResults is in the wrong structure based on the documentation https://www.npmjs.com/package/jira-client-xray
Please post the request being sent.

Azure Devops unable to populate picklist

I followed the tutorial found at
https://learn.microsoft.com/en-us/azure/devops/extend/develop/service-endpoints?view=azure-devops
The api call is right because if I don't authenticate it shows the correct path in the error message. Entering the url that it shows in the message in a browser gives the correct json.
The picklist object will act like it is trying to load but will end up showing no results found.
Can you use a personal company api to load a picklist using server endpoint?
How do you debug this. All I see in the network tab on debugging tools is the 200 from azure making the post.
This is the JSON
{
"meta": {
"record_count": 5,
"source": "mongodb",
"searchParams": {
"versions.start_date": {
"$gte": "2019-08-30T00:11:55.329Z"
}
},
"paging": {
"num": 10,
"start": 0
}
},
"screenshots": [
{
"screenshot_test_id": 3946619,
"url": "https://www.google.com",
"test_name": null,
"created_date": "2019-10-27T21:26:32.0 ```
This is the datasources from the vss.extension
"dataSources": [
{
"name": "CBTAPIReturn",
"endpointUrl": "{{endpoint.url}}",
"resultSelector": "jsonpath:$[*].screenshots"
}
]
inputs and bindings from the task
"inputs": [
{
"name": "CBTService",
"type": "connectedService:CBTServiceEndpoint",
"label": "CBT service/server end point",
"defaultValue": "",
"required": true,
"helpMarkDown": "Select the CBT end point to use. If needed,selecton 'manage', and add a new service endpoint of type 'CBT server connection'"
},
{
"name": "CBT API Response",
"type": "pickList",
"label": "CBT API Response",
"required": true,
"helpMarkDown": "Select the name combination that you want to use.",
"properties": {
"EditableOptions": "True"
}
}
],
"dataSourceBindings": [
{
"target": "CBT API Response",
"endpointId": "$(CBTService)",
"dataSourceName": "CBTAPIReturn"
```

There was a problem with the requested skill's response using template, Alexa skill using template directive

I have an issue with alexa skill in node.
i'm making an skill that connect with db via HTTS.response
everything works fine until I want to show the results in a template.
this its the response.
{
"outputSpeech": {
"type": "PlainText",
"text": "That's sound good. Your search is Property Type: residential - City:Petersburg - Zip Code:33715 - Bedrooms:2 - Price: $100000"
},
"directives": [
{
"type": "Display.RenderTemplate",
"template": {
"type": "ListTemplate2",
"token": "ShowHomeView",
"backButton": "hidden",
"backgroundImage": {
"contentDescription": "",
"sources": [
{
"url": "https://s3.amazonaws_com/ask-samples-resources/berryImages/main_blur2.png"
}
]
},
"title": "Search Results",
"listItems": [
{
"token": 1,
"image": "https://mydomain/images/fine_arts-1550.jpg",
"textContent": "This is my list item 1"
},
{
"token": 2,
"image": "https://mydomain/images/fine_arts-1550.jpg",
"textContent": "This is my list item 2"
},
{
"token": 3,
"image": "https://mydomain/images/fine_arts-1550.jpg",
"textContent": "This is my list item 3"
}
]
}
},
{
"type": "Hint",
"hint": {
"type": "PlainText",
"text": " select number two. "
}
}
],
"shouldEndSession": false
}
and in alexa console say:
There was a problem with the requested skill's response
and in the device log say.
"descriptiveText": [
"Request Identifier: amzn1.echo-api.request.f6d03bab-05b2-449f-877b-b58f8e28274b",
"",
"The skill returned an invalid response"
],
What could be causing this error?
thnks in advance

POST JSON to log event into Application Insights

I need to write a PowerShell Script shell to log an entry into App Insights. I found this post which is useful but I am having a hard time writing to different fields other than the ones being used there. For example I am trying to populate the message field. I don't know the field name in JSON and I don't know where it should go. As you can see in this example I tried placing it everywhere and still did not work. I tried searching for their REST API documentation and still can't find the specs for the JSON.
Can anyone help?
[{
"name": "Microsoft.ApplicationInsights.Event",
"time": "2018-09-20T16:57:16.1771869Z",
"iKey": "1234",
"message": "This is a message",
"tags": {
"ai.operation.name": "Name",
"ai.user.id": "userId",
"ai.cloud.roleInstance": "Machine 1"
},
"data": {
"baseType": "EventData",
"message": "message1",
"baseData": {
"name": "Event from my service",
"message": "message2",
"properties": {
"x": "value x",
"y": "value y",
"z": "value z"
}
}
}
}]
We've been recently trying to achieve the same and didn't find good instructions on the web too, so posting our findings here.
1. API Endpoint
1.1 Authentication
You will need your instrumentation key - see How to get Azure Instrumentation Key for details. That key must be stored in the "iKey" property of the message payload.
1.2 Request
Overall, there seem to be 4 different message types (defined by the "baseType" property) that can be set. All of them need to are sent via POST to the same endpoint
POST https://dc.services.visualstudio.com/v2/track
[ { MESSAGE1 }, { MESSAGE2 }, ... ]
Where the format of each message depends on its type. No authentication headers are needed - the "iKey" field of the message serves as the authentication key.
1.3 Response
The following response is sent in case of success
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"itemsReceived" : 1,
"itemsAccepted" : 1,
"errors":[]
}
Where the "itemsAccepted" property will indicate the number of records accepted by Application Insights.
2. Message Formats
Each individual message in the array must follow one of the following 4 possible JSON formats.
2.1 The "EventData" ("CUSTOM EVENT") message format
This event is shown as the "Custom Event" in the Application Insights. The following payload must be used:
{
"name": "Microsoft.ApplicationInsights.Event",
"time": "2015-05-21T16:43:14.4670675-06:00",
"iKey": "[MyInstrumentationKey]",
"tags": {
},
"data": {
"baseType": "EventData",
"baseData": {
"ver": 2,
"name": "SampleEvent",
"properties": {
"x": "value x",
"y": "value y",
"z": "value z"
}
}
}
}
2.2 The "MessageData" ("TRACE") message format
This event is shown as the "TRACE" in the Application Insights. The following payload must be used:
{
"name": "Microsoft.ApplicationInsights.Event",
"time": "2021-02-25T21:35:45.0000000Z",
"iKey": "[MyInstrumentationKey]",
"tags":{
},
"data": {
"baseType": "MessageData",
"baseData": {
"ver": 2,
"message": "Simple Trace Log Message",
"severityLevel": 2,
"properties": {
"x": "value x",
"y": "value y",
"z": "value z"
}
}
}
}
severityLevel meaning
level 0 = "Verbose"
level 1 = "Information"
level 2 = "Warning"
level 3 = "Error"
level 4 = "Critical"
2.3 The "MetricData" message format
The following payload must be used:
{
"name": "Microsoft.ApplicationInsights.Event",
"time": "2021-02-25T21:35:45.0000000Z",
"iKey": "[MyInstrumentationKey]",
"tags": {
},
"data": {
"baseType": "MetricData",
"baseData": {
"ver": 2,
"metrics": [
{
"name": "BasicMetric",
"kind": "Measurement",
"value": 42
}
],
"properties": {
"x": "value x",
"y": "value y",
"z": "value z"
}
}
}
}
2.4 The "ExceptionData" message format
The following payload must be used:
{
"name": "Microsoft.ApplicationInsights.Event",
"time": "2021-02-25T21:35:45.0000000Z",
"iKey": "[MyInstrumentationKey]",
"tags": {
},
"data": {
"baseType": "ExceptionData",
"baseData": {
"ver": 2,
"handledAt": "UserCode",
"properties": {
"x": "value x",
"y": "value y",
"z": "value z"
},
"exceptions": [
{
"id": 26756241,
"typeName": "System.Exception",
"message": "Something bad has happened!",
"hasFullStack": true,
"parsedStack": [
{
"level": 0,
"method": "Console.Program.Main",
"assembly": "Console, Version=1.0",
"fileName": "/ApplicationInsights/Test.cs",
"line": 42
}
]
}
]
}
}
}
You can put the message in the properties:{}.
After execute the powershell script, go to azure portal, you should see the message field there:
But if you wanna add a field in the Custom Event Properties section, there seams no way to do it.

Resources