Reports for Flutter test_driver execution - flutter

I need to generate a report about how much tests was executed, how much failed, why test was failed. Is there some option to do it with test_driver?
We can generate json report for flutter unit tests with command flutter test --machine. Is there something same for flutter drive?

Although flutter driver doesn't generate a full-fledged test summary report out-of-box, there's an alternative way to do it using flutter_gherkin plugin. This plugin makes use of ATDD style of writing integration tests leveraging flutter driver and its methods.
Checkout the example from plugin's repo.
This plugin has a configuration file (just like instrumentation file in Google Espresso) which has a reporter parameter to specify json reporter that generates report in json format.
Below is the content of generated json report:
[{
"keyword": "Feature",
"uri": "./test_driver/features/custom_parameter_example.feature",
"id": "custom parameter example",
"name": "Custom Parameter Example",
"description": "",
"line": 0,
"elements": [{
"keyword": "Scenario",
"type": "scenario",
"id": "custom parameter example;custom colour parameter",
"name": "Custom colour parameter",
"description": "",
"line": 3,
"steps": [{
"keyword": "Given ",
"name": "I pick the colour red",
"line": 4,
"result": {
"status": "passed",
"duration": 6000000
}
}, {
"keyword": "Given ",
This report can then be converted into html report using cucumber-html-reporter per your requirement.
This approach sounds a bit tedious and the format may or may not be the way you want, because you might need to re-write your tests in Given When Then format in order for json report to be generated, but you may give this approach a try to see if this works for you.

Yes, reports can be generated by setting paths in the test driver class, where the report path is initialized.
import 'package:integration_test/integration_test_driver.dart'
as integration_test_driver;
Future<void> main() async {
/// Repports are generated on given path, once all tested passed,
integration_test_driver.testOutputsDirectory =
'integration_test/reports';
await integration_test_driver.integrationDriver(
timeout: const Duration(minutes: 60));
}
Note: This will work using the flutter drive command.

Related

Azure devops Server 2019 - Error while creating Workitem states

I am trying to create a state for existing work item.
For Get, the url will show the list of States under Bug.
But am facing an issue when I do Post with json.
https://{server}/{collection}/_apis/work/processes/{processid}/workItemTypes/Microsoft.VSTS.WorkItemTypes.Bug/states?api-version=5.0-preview.1
Json:
{"name": "Test-Status", "color": "007acc", "stateCategory": "InProgress", "order": 3 }
Below is the error details
Http - 404 - NotFound
{ "$id": "1", "innerException": null, "message": "VS402805: Cannot
find work item type with reference name
'Microsoft.VSTS.WorkItemTypes.Bug' in process named
'dcdcc713-ebc6-4940-aa9d-d6c9d3e00e39'.", "typeName":
"Microsoft.TeamFoundation.WorkItemTracking.Server.Metadata.ProcessWorkItemTypeDoesNotExistException,
Microsoft.TeamFoundation.WorkItemTracking.Server", "typeKey":
"ProcessWorkItemTypeDoesNotExistException", "errorCode": 0, "eventId":
3200 }
Any help regarding this is appreciated.
The problem should be:Microsoft.VSTS.WorkItemTypes.Bug. I think you need use the format like processName.typeName. In addition the original process cannot be customized , only the inherited process can be customized.
Here I test your api in postman,it can work well.
I had the same problem.
When you create a new process, all the Work Item Types from the Parente process (Agile, Scrum, etc.) starts with the Microsoft.VSTS.WorkItemTypes.(Epic, Bug, etc.) and you can't modify it, you will have the error:
"VS402805: Cannot find work item type with reference name 'Microsoft.VSTS.WorkItemTypes.Bug' in process name ..."
To solve this, you just need to create a new work item type that inherits that work item type that you want to use, post example:
POST https://dev.azure.com/{organization}/_apis/work/processes/{processId}/workitemtypes?api-version=6.0-preview.2
{
"referenceName": "ProcessName.Issue",
"name": "Issue",
"description": "your description",
"color": "B4009E",
"icon": "icon_traffic_cone",
"inheritsFrom": "Microsoft.VSTS.WorkItemTypes.Issue"
}
I hope it helps.
Have a nice day!

Can someone explain, what does the webhook do in api.ai?

I am new to api.ai. I want to send data to the web server and receive it and then give it to the users? From the documentation that I read, I understood that I have to use a webhook. But I am not sure how will api.ai send and receive the data?
Can the webhook be developed in any language?
The webhook is a web service that you implement in any language and on any platform, with an HTTP (must be https for ghome) and JSON interface, that fullfils (in their lingo) a user intent.
API.AI matches a user utterance to an intent (which then suggests entity values and a response) and they pass these in the call to your web service. You do whatever processing you need - your domain logic - and then return a speech response for the user and optionally some API.AI contexts.
You can read more about it (and about slot filling fulfillment which is a little different) here.
You can visualize the working of a webhook like a block where data request comes in JSON format somewhat like this:
{
"id": "7aef9329-4a32-4d59-b661-8bf380a0f35b",
"timestamp": "2017-06-07T05:36:12.641Z",
"lang": "en",
"result": {
"source": "agent",
"resolvedQuery": "hi",
"action": "order.pizza",
"actionIncomplete": true,
"parameters": {
"address": "",
"crust": "",
"sauce": "",
"size": "",
"time": "",
"topping": "",
"type": ""
}
}
}
and another json file is returned to it according to the prescribed settings.

Sailsjs: Query association using blueprint API and query string

If possible I'd like to query a related model using a query parameter rather than overwriting a blueprint action. I'm not sure if I need to manually populate an association for this to work.
I have two related models: Idea and Tag. An Idea can have many Tags, and a Tag can be associated with many Ideas (M-M association). I would like to query all Ideas that are associated with a given Tag name.
I had this working in the past, but now the result is always an empty array. I looked through my git history and I have two different possible solutions that I have used in the past
Blueprint Endpoint (worked in the past?):
http://localhost:1337/Idea?tags.text[]=GIS
http://localhost:1337/Idea?tags.text=GIS
Example Idea instance (other associations removed for brevity):
{
"tags": [
{
"text": "GIS",
"description": "Geographic Information Systems involves the association of location and attribute data, data collection, and analysis.",
"approved": true,
"createdAt": "2015-08-26T13:27:19.593Z",
"updatedAt": "2015-08-26T13:29:44.209Z",
"id": "55ddbeb71670cf062be4e5c0"
}
],
"title": "First Idea",
"description": "Let's all do some more GIS!",
"status": "Proposed",
"createdAt": "2015-08-26T13:30:03.238Z",
"updatedAt": "2015-08-26T13:30:03.240Z",
"id": "55ddbf5b1670cf062be4e5c1"
}

SharePoint 2013 - Associating Site Columns With Content Types Using the REST API

I'm trying to use the REST API to programatically create site columns and content types. Everything works fine until I try to associate my site columns with my content types.
By this point in my code the site columns and content types already exist...
I am sending a POST to the following URL...
http://mydevmachine/sites/claimsreports/_api/web/ContentTypes('0x01003E9D5AD94A5DCD46876B7BFFCEA9B60C')/FieldLinks
Here is the information I am sending in the request body...
{
"__metadata": {
"type": "SP.FieldLink"
},
"Id": "9400d057-ba2c-4ab4-9ce0-671b858fd849",
"Name": "BusinessCategory",
"Hidden": false,
"Required": false
}
Here is the error I get back in response...
{"error":{"code":"-2147467261, System.ArgumentNullException","message":{"lang":"en-US","value":"Value cannot be null.\r\nParameter name: parameters"}}}
I have tried several other options without success. For example, I have tried using "__metadata" : { "type": "SP.FieldLinkCreationInformation"} but everything I try with this __metadata type result in this error...
{"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"A type named 'SP.FieldLinkCreationInformation' could not be resolved by the model. When a model is available, each type name must resolve to a valid type."}}}
It sounds like SharePoint is telling me that this "type" is invalid. It seems like this should be possible with SharePoint 2013 since the documentation seems to imply that its possible...
documentation
If anyone has any ideas I would be greatful for the suggestions. Thanks!
Based on the documentation, I would try that:
Endpoint (note the /add at the end):
http://mydevmachine/sites/claimsreports/_api/web/ContentTypes('0x01003E9D5AD94A5DCD46876B7BFFCEA9B60C')/FieldLinks/add
Body (wrap your properties in a parameters property):
{"parameters":
{
"__metadata": {"type": "SP.FieldLink"},
"Id": "9400d057-ba2c-4ab4-9ce0-671b858fd849",
"Name": "BusinessCategory",
"Hidden": false,
"Required": false
}
}

Facebook API for extracting basic(Public) profile info of a person

Actually I want to extract basic(Public Profile) information of a person on Facebook by it's name or email-ID without any type of authentication. So, can anyone tell me the detailed procedure how i can acheive this using Java Programming and i want the result in XML format
https://graph.facebook.com/4
Will give you a result similar to -
{
"id": "4",
"name": "Mark Zuckerberg",
"first_name": "Mark",
"last_name": "Zuckerberg",
"link": "http://www.facebook.com/zuck",
"username": "zuck",
"gender": "male",
"locale": "en_US"
}
That will give you all the public information about a user. The response you get is a JSON object. If you want it in XML you'll have to manually convert it.
Beaware that not all USER_ID's will return information. It all depends on the user's privacy settings.
I have no knowledge of JAVA so I can't give you and code samples, but you can make a simple HTTP request to that URL using whatever methods you feel comfortable with...