Mobile tests API

Updated 2 years ago by SYED A HAMID

All get requests need header with Subscription key and value – ‘Subscription Key:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx‘. If you do not have subscription key click here

View all available devices for Test Runs.

GET: https://api.sofy.ai/v1/applications/availabledevices < get all free available devices >

Parameters

None

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications/availabledevices

Output Json
[
{
"DeviceId": 68,
"Name": "ANDROID",
"ManufacturerType": "MOTOROLA",
"ModelType": "Moto G (5) Plus",
"Device_OS": "Nougat",
"DeviceName": "Moto G (5) Plus",
"Display": "1080 x 1920",
"RAM": "3 GB",
"OSName": "Nougat",
"OSBUILD": "7.0",
"OSAPI": "24",
"BoardType": "msm8953",
"CPUType": "armeabi-v7a"
}
]

Create new Test Runs for Android/iOS applications

POST: https://api.sofy.ai/v1/applications/create?deviceid=68 < create a new apptest run for android/IOS >

Parameters

DeviceId

CURL Request

curl -X POST -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" -F "applicationFile=@D:\Microsoft.apk" https://api.sofy.ai/v1/applications/create?deviceid=68

Output Json
[
{
"ApplicationGUID": "09b4bf83-1697-45d6-8ab6-55fb4ed88762",
"ApplicationID": 23942,
"Platform": 1,
"PackageName": "com.kithnyc.kith",
"CreateDateTime": "2018-11-07T11:24:08.813",
"ModifiedDateTime": "2018-11-10T15:07:35.94",
"PlatformName": "ANDROID"
}
]

Get all applications previously tested by a particular subscription key

GET: https://api.sofy.ai/v1/applications/Lists < returns all the applications for the given subscription id >

Parameters

None

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications/Lists

Output Json
[
{
"ApplicationGUID": "264b22fd-37bb-4a0c-a21c-c33316007ec4",
"ApplicationID": 22578,
"Platform": 1,
"PackageName": "com.microsoft.office.onenote",
"CreateDateTime": "2018-06-01T06:47:01.137",
"ModifiedDateTime": "2018-11-12T11:45:39.193",
"PlatformName": "ANDROID"
}
]

Get details of a particular Application previously tested

https://api.sofy.ai/v1/applications?appid=23942 < returns the specific < applicationid > value >

Parameters

ApplicationID

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications?appid=23942

Output Json
[
{
"ApplicationGUID": "09b4bf83-1697-45d6-8ab6-55fb4ed88762",
"ApplicationID": 23942,
"Platform": 1,
"PackageName": "com.kithnyc.kith",
"CreateDateTime": "2018-11-07T11:24:08.813",
"ModifiedDateTime": "2018-11-10T15:07:35.94",
"PlatformName": "ANDROID"
}
]

Get information on last 100 Test Runs by a particular subscription key

GET: https://api.sofy.ai/v1/applications/testruns/lists < show the last 100 test runs for a given subscriptions >

Parameters

None

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications/testruns/lists

Output Json
[
{
"ApplicationId": 22578,
"TestRunID": 32182,
"StartDate": "2018-11-12T11:19:08.03",
"DeviceOSName": "Kit Kat",
"DeviceAPILevel": "23",
"DeviceOSBuildNumber": "4.4.4",
"DeviceManufacturer": "Emulator",
"DeviceModel": "None",
"StatusValue": "SUBMITTED FOR QBOT"
},
{
"ApplicationId": 22578,
"TestRunID": 32181,
"StartDate": "2018-11-12T11:19:08.03",
"DeviceOSName": "Kit Kat",
"DeviceAPILevel": "23",
"DeviceOSBuildNumber": "4.4.4",
"DeviceManufacturer": "Emulator",
"DeviceModel": "None",
"StatusValue": "SUBMITTED FOR QBOT"
}
]

Get information on all Test Runs associated with an application

GET: https://api.sofy.ai/v1/applications/testruns?appid=23942 < returns all the test runs for < appid > >

Parameters

ApplicationID

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications/testruns?appid=23942

Output Json
[
{
"ApplicationId": 23942,
"TestRunID": 32153,
"StartDate": "2018-11-10T14:14:48.727",
"DeviceOSName": "Nougat",
"DeviceAPILevel": "25",
"DeviceOSBuildNumber": "7.1.1",
"DeviceManufacturer": "motorola",
"DeviceModel": "Moto E (4) Plus",
"StatusValue": "COMPLETED BY QBOT"
}
]

Get summary for a particular Test Run

GET: https://api.sofy.ai/v1/applications/testresults/summary?testrunid=32013 (summary for app test result)

Parameters

TestRunID

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications/testresults/summary?testrunid=32013

Output Json
[
{
"TestRunID": 32013,
"Audit_Performance_Passed": 207,
"Audit_Performance_Total": 209,
"Performance_Issues": 2,
"Audit_VisualQuality_Passed": 622,
"Audit_VisualQuality_Total": 1020,
"VisualQuality_Issues": 398,
"Audit_Bestpractices_Passed": 265,
"Audit_Bestpractices_Total": 265,
"BestPractice_Issues": 0,
"Audit_Security_Passed": 15,
"Audit_Security_Total": 29,
"Security_Issues": 14,
"Audit_Reliability_Passed": 4,
"Audit_Reliability_Total": 4,
"Reliability_Issues": 0
}
]

Get a list of all screens and Test Run’s audit summary associated with a particular Test Run

GET: https://api.sofy.ai/v1/applications/testresults?testrunid=32013 < returns the list of all the application screens and its audits summary for each screen>

Parameters

TestRunID

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications/testresults?testrunid=32013

Output Json
[
{
"TestRunId": 32013,
"ScreenshotID": 706681,
"ScreenName": " AppLaunch",
"Audit_Performance_Passed": 1,
"Audit_Performance_Total": 2,
"Performance_Issues": 1,
"Audit_VisualQuality_Passed": 0,
"Audit_VisualQuality_Total": 0,
"VisualQuality_Issues": 0,
"Audit_BestPractices_Passed": 265,
"Audit_BestPractices_Total": 265,
"BestPractices_Issues": 0,
"Audit_Security_Passed": 16,
"Audit_Security_Total": 25,
"Security_Issues": 9,
"Audit_Reliability_Passed": 4,
"Audit_Reliability_Total": 4,
"Reliability_Issues": 0,
"UILoadTime": 0,
"Memory": 0,
"CPU": 0,
"TimeTaken": 0,
"TestCaseTitle": "Starting app",
"Statusvalue": "TESTPASSED"
}
]

Get a list of all audits performed during a particular Test Run

GET: https://api.sofy.ai/v1/applications/testresults/audits?testrunid=32013

Parameters

TestRunID

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications/testresults/audits?testrunid=32013

Output Json
[
{
"TestRunId": 32013,
"ScreenshotID": 706681,
"ScreenName": " AppLaunch",
"Audit_Performance_Passed": 1,
"Audit_Performance_Total": 2,
"Performance_Issues": 1,
"Audit_VisualQuality_Passed": 0,
"Audit_VisualQuality_Total": 0,
"VisualQuality_Issues": 0,
"Audit_BestPractices_Passed": 265,
"Audit_BestPractices_Total": 265,
"BestPractices_Issues": 0,
"Audit_Security_Passed": 16,
"Audit_Security_Total": 25,
"Security_Issues": 9,
"Audit_Reliability_Passed": 4,
"Audit_Reliability_Total": 4,
"Reliability_Issues": 0,
"UILoadTime": 0,
"Memory": 0,
"CPU": 0,
"TimeTaken": 0,
"TestCaseTitle": "Starting app",
"Statusvalue": "TESTPASSED"
}
]

Get details and audit summary for a particular screen

GET: https://api.sofy.ai/v1/applications/testresults/audits?screenshotid=706681

Parameters

ScreenshotID

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications/testresults/audits?screenshotid=706681

Output Json
[
{
"TestRunId": 32013,
"ScreenshotID": 706681,
"ScreenName": " AppLaunch",
"Audit_Performance_Passed": 1,
"Audit_Performance_Total": 2,
"Performance_Issues": 1,
"Audit_VisualQuality_Passed": 0,
"Audit_VisualQuality_Total": 0,
"VisualQuality_Issues": 0,
"Audit_BestPractices_Passed": 265,
"Audit_BestPractices_Total": 265,
"BestPractices_Issues": 0,
"Audit_Security_Passed": 16,
"Audit_Security_Total": 25,
"Security_Issues": 9,
"Audit_Reliability_Passed": 4,
"Audit_Reliability_Total": 4,
"Reliability_Issues": 0,
"UILoadTime": 0,
"Memory": 0,
"CPU": 0,
"TimeTaken": 0,
"TestCaseTitle": "Starting app",
"Statusvalue": "TESTPASSED"
}
]

Get a list of all audits performed during a particular Test Run belonging to a particular category (Visual Quality, Performance, Security, Best Practices, Reliability)

https://api.sofy.ai/applications/testresults/audits?testrunid=121&category=visualquality < returns the list of specified the audits for a given run for a given category>

Parameters

TestRunID

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/applications/testresults/audits?testrunid=121&category=visualquality

Category

Visual Quality, Best Practices, Security, Reliability, Performance

Output Json
[
{
"TestRunId": 32013,
"ScreenshotID": 706681,
"ScreenName": " AppLaunch",
"Audit_Performance_Passed": 1,
"Audit_Performance_Total": 2,
"Performance_Issues": 1,
"Audit_VisualQuality_Passed": 0,
"Audit_VisualQuality_Total": 0,
"VisualQuality_Issues": 0,
"Audit_BestPractices_Passed": 265,
"Audit_BestPractices_Total": 265,
"BestPractices_Issues": 0,
"Audit_Security_Passed": 16,
"Audit_Security_Total": 25,
"Security_Issues": 9,
"Audit_Reliability_Passed": 4,
"Audit_Reliability_Total": 4,
"Reliability_Issues": 0,
"UILoadTime": 0,
"Memory": 0,
"CPU": 0,
"TimeTaken": 0,
"TestCaseTitle": "Starting app",
"Statusvalue": "TESTPASSED"
}
]

Get a list of all audits performed on a particular screen

GET: https://api.sofy.ai/v1/applications/testresults/audits?screenshotid=706681 < returns all the audits for a given screen for a given test caseid>

Parameters

ScreenshotID

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications/testresults/audits?screenshotid=706681

Output Json
[
{
"TestRunId": 32013,
"ScreenshotID": 706681,
"Audit_Category": "Performance",
"Audit_Code": "PF-03",
"TimeTaken": 704,
"Status": "FAILED",
"Title": "App targets latest android SDK",
"Description": "targetSdk is needed to provide forward compatibility. Updating to target latest SDK should be a high priority for every app. (https://developer.android.com/docs/quality-guidelines/core-app-quality)",
"Suggestions": "targetSDK is needed to provide forward compatibility. Updating to target latest SDK should be a high priority for every app. (https://developer.android.com/docs/quality-guidelines/core-app-quality)",
"AuditOutput": "App does not target Latest available SDK (27 ).",
"AuditLayout": null,
"Impact": "Low"
}
]

Get a list of all nuggets generated for a particular Application

GET: https://api.sofy.ai/v1/applications/testresults/nuggets?appid=23942 < returns all the nuggets>

Parameters

appid (ApplicationID)

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications/testresults/nuggets?appid=23942

Output Json
[
{
"TestRunId": 32013,
"ScreenshotID": 706681,
"Audit_Category": "Performance",
"Audit_Code": "PF-03",
"TimeTaken": 704,
"Status": "FAILED",
"Title": "App targets latest android SDK",
"Description": "targetSdk is needed to provide forward compatibility. Updating to target latest SDK should be a high priority for every app. (https://developer.android.com/docs/quality-guidelines/core-app-quality)",
"Suggestions": "targetSDK is needed to provide forward compatibility. Updating to target latest SDK should be a high priority for every app. (https://developer.android.com/docs/quality-guidelines/core-app-quality)",
"AuditOutput": "App does not target Latest available SDK (27 ).",
"AuditLayout": null,
"Impact": "Low"
}
]

Get a list of all nuggets generated for a particular Test Run

GET: https://api.sofy.ai/v1/applications/testresults/nuggets?testrunid=32013 < returns all the nuggets for a given test run >

Parameters

TestRunID

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications/testresults/nuggets?testrunid=32013

Output Json
[
{
"AppNuggetId": 7472,
"ApplicationId": 23942,
"TestRunId": 32013,
"AuditId": 1655,
"Description": "HTTP connections captured. Data is being transferred without SSL/TLS encryption. HTTP Connections:1 ",
"Archived": false,
"CreatedDateTime": "2018-11-08T11:04:57.5",
"CreatedBy": "SofyStaging",
"ImpactedScreens": 1,
"Category": "Security",
"Impact": "Medium",
"AUDITDESCRIPTION": "All network traffic is sent over SSL",
"Suggestions": "Ensure all network connections use secure protocols such as HTTPS"
}
]

Get description of a particular nugget and the screens on which it was generated

GET: https://api.sofy.ai/v1/applications/testresults/nuggets?nuggetid=7469 < returns the detail of the nugget >

Parameters

NuggetID

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications/testresults/nuggets?nuggetid=7469

Output Json
[
{
"AppNuggetId": 7469,
"ApplicationId": 23942,
"TestRunId": 32013,
"AuditId": 637,
"Description": "Gutters are the spaces between columns. They help separate content. Gutters can be adjusted to creat",
"Archived": false,
"CreatedDateTime": "2018-11-08T11:04:56.403",
"CreatedBy": "SofyStaging",
"ImpactedScreens": 98,
"Category": "VisualQuality",
"Impact": "Medium",
"AUDITDESCRIPTION": "Whitespace should not be as large as the items",
"Suggestions": "Large whitespace between items increase average time per action for the user and decrease accessibility of the particular screen",
"ScreenshotIDs": [
0,
706706,
706707
]
}
]

Get description of all credentials belonging to a particular Application Id

GET: https://api.sofy.ai /v1/ApplicationCredentials/Get?AppID=23216

Parameters

Application ID

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications/testresults/nuggets?nuggetid=7469

Output Json
[
{
"PackageName": "com.flipkart.android",
"AppCredentialID": 44,
"CredentialName": "teft",
"CredentialType": "Facebook",
"DomainAuthority": null,
"SignInURL": null,
"UserName": "test",
"UserNameControl": null,
"UserPassword": "test",
"UserPasswordControl": null,
"SubmitControl": null,
"CreateDateTime": "2018-12-18T07:00:18.87",
"Archive": false
}
]

Get description of a particular Application Credential Id

GET: https://api.sofy.ai /v1/ApplicationCredentials/GetbyAppCred?AppCredID=2

Parameters

Applicaion Credenial ID

Curl Request

curl -H "SubscriptionKey:xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" https://api.sofy.ai/v1/applications/testresults/nuggets?nuggetid=7469

Output Json
[
{
"PackageName": "https://www.homedepot.com",
"AppCredentialID": 2,
"CredentialName": "",
"CredentialType": "custom",
"DomainAuthority": "gmail",
"SignInURL": "dfdsfd",
"UserName": "cvvxcvcx",
"UserNameControl": "xxxxx",
"UserPassword": "xxxccccqcccc",
"UserPasswordControl": "vcvxccxc",
"SubmitControl": "xzczxcxzc",
"CreateDateTime": "2018-11-28T11:45:00.347",
"Archive": false
}
]

Create new Application Credentials

POST: https://api.sofy.ai /v1/ApplicationCredentials/Create

Curl Request

curl -X POST -H "SubscriptionKey: xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx" -H "Content-Type:application/json" -d "[ { "ApplicationID": "23999", "CredentialName": "test", "CredentialType": "facebook", "DomainAuthority": "facebook", "SignInURL": "tester", "UserName": "tester", "UserNameControl": "", "UserPassword": "tester", "UserPasswordControl": "", "SubmitControl": "tester", "CreatedBy": "usman@sofy.ai", "ModifiedBy": "usman@sofy.ai" } ]" https://api.sofy.ai /v1/ApplicationCredentials/Create

Input Json
[
{
"ApplicationID": "23999",
"CredentialName": "test",
"CredentialType": "facebook",
"UserName": "tester",
"UserPassword": "tester"
}
]
Output Json
[
{
"AppCredentialID": 45,
"ApplicationID": 23999,
"CredentialName": "tefasadsst",
"CredentialType": "facebook",
"DomainAuthority": null,
"SignInURL": null,
"UserName": "tesfasfsdfaster",
"UserNameControl": null,
"UserPassword": "testasdasdasfaser",
"UserPasswordControl": null,
"SubmitControl": null,
"CreateDateTime": "2018-12-18T07:00:32.923",
"ModifiedDateTime": "2018-12-18T07:00:32.923",
"CreatedBy": null,
"ModifiedBy": null,
"Archive": false
}
]


How did we do?