Skip to content

Instantly share code, notes, and snippets.

@manvillej
Created April 24, 2021 15:20
Show Gist options
  • Save manvillej/aa0dc3aa9374d0fa64e80d6f531ab55c to your computer and use it in GitHub Desktop.
Save manvillej/aa0dc3aa9374d0fa64e80d6f531ab55c to your computer and use it in GitHub Desktop.
var ATFGraphQLAPI = {
atfTestToJson: function(test){
return {
"active": test.getDisplayValue("active"),
"sys_id": test.getValue("sys_id"),
"name": test.getValue("name"),
"description": test.getValue("description")
};
},
atfTestResultToJson: function(testResult){
return {
"id": testResult.getUniqueValue(),
"pending": testResult.getValue("pending_time"),
"duration": testResult.getValue("run_time"),
"startTime": testResult.getValue("start_time"),
"endTime": testResult.getValue("end_time"),
"output": testResult.getValue("output"),
"status": testResult.getValue("status"),
"userAgents": testResult.getValue("user_agents")
};
},
atfTestSuiteResultToJson: function(Suite){
return {
"id": Suite.getUniqueValue(),
"name": Suite.getValue("name"),
"active": Suite.getValue("active"),
"filter": Suite.getValue("input_filter"),
"description": Suite.getValue("description"),
"parent": Suite.getValue("parent")
};
},
type: 'ATFGraphQLAPI'
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment