Generating urls for specific filter settings (REST API)Answered
It would be great if we could generate links to SkyWATS pages with predefined filter set.
What I have in mind is: when testing a converter, I have a specific set of data I can use as filter to see the converted reports, their yield, test&step analysis and so on. I am developing a tool to help with converter testing. To asses the accuracy of conversion I need to get the results from server and compare it with what I expect based on the source reports.
It would help tremendously if instead of filling in the filter by hand I could just fill it in programmatically and get a link leading straight to my results.
It would be even better if I could get the results as a response, or at least automatically download them exported to an excel sheet, but even the filter alone would help.
One solution is to use the API to query the test results. Here is an example:
public void LoadUUTReport()
TDM api = new TDM();
WatsReportHeader h = api.FindReports("(PN eq 'FATPartNo') and (ReportType eq 'UUT')", 1);
UUTReport r = (UUTReport)api.LoadReport(h.Guid.ToString());
UUTPartInfo pInfo = r.PartInfo;
Step allSteps = r.AllSteps;
Step failedSteps = r.FailedSteps;
Step specificSteps = r.FindSteps("SinglePass", "/pass/fail tests/");
SequenceCall allSequenceSteps = r.AllSteps.OfType<SequenceCall>().ToArray();
NumericLimitStep stepOfInterest = r.AllSteps.Where(s => s.Name == "SingleGELEFail").FirstOrDefault() as NumericLimitStep;
NumericLimitTest numericLimitTest = stepOfInterest.Tests;
StringValueStep stringValueStepFromMultiple = r.AllSteps.Where(s => s.Name == "Multiple tests" && s.StepPath == "/stringvalue tests/").FirstOrDefault() as StringValueStep;
StringValueTest stringValueTest = stringValueStepFromMultiple.Tests.Where(t => t.MeasureName == "MultiCasePass").FirstOrDefault();
Step graphStep = r.FindSteps("Fibionacci", null).First();
Chart chart = graphStep.Chart;
double xValues, yValues;
chart.Series.GetValues(out xValues, out yValues);
Attachment attachment = r.FindSteps("Attach file", null).First().Attachment;
Assert.IsTrue(attachment.Data.Length > 10);
You may get the result you want in the rest API.
The app section have actions to list UUTs or get yield calculations by a filter.
You may also try to generate your own links with help of the "share filter" behavior. You will manually have to base64 encode your filter.
The base64 encoded part looks like this:
What I meant is that it would be awesome if we can fill up the filter parameters over the URL.
Because if I do a "Test step yield & analysis" and if I want to refer this results into a report then it would be great if I could add a link in this report which would lead to the results on Wats.
Now I need to write down all the required filter parameters into the report that others are able to reproduce these results in Wats.
One approach would be to make a specific filter but to make a filter for each reference it would end up in a mess.
Please sign in to leave a comment.