Last updated on : 21 Jan 2025
XCTest
XCUITest is a mobile automation framework provided by Apple that helps user write UI tests for your iOS applicationsThis guide will help you run your first XCUI test on pCloudy.
Pre-requisites
- User should be registered on Pcloudy platform.
- Need access to .zip file If User do not have .ipa files and are looking to simply try App Automate, user can download our sample zip file
- To download sample zip file click the link below.
ArchiveXCTestPRod(1).zip
- Upload the sample zip file in the MyData section manually or using API.
- Upload your iOS app (.ipa) file on the pCloudy platform using an API request. curl --location --request POST URL format:
curl -X POST -F "file=@/File_Path" -F "source_type=raw" -F "token=authToken" -F "filter=filter" <Cloud URL>/api/upload_file
Steps To Execute XCtest
After the user uploads the app and test suite on the pCloudy platform, Use the below mentioned API's 1.Get Device list for iOS-This api is used to get iOS device list
Endpoint: request POST: {{URL}}/api/devices
Sample request
{
"token": "jmxbd3jvrdt74nzcjc43ccth",
"duration": 15,
"platform": "ios",
"available_now": "true"
}
Sample response
{
"result": {
"token": "jmxbd3jvrdt74nzcjc43ccth",
"code": 200,
"models": [
{
"index": 1,
"full_name": "Apple_iPhoneSE_Ios_11.2.5_58ce2",
"id": 799,
"alias_name": "58ce2",
"model": "iPhoneSE",
"display_name": "iPhone SE",
"platform": "ios",
"version": "11.2.5",
"cpu": "Dual Core",
"bucket": 3,
"manufacturer": "Apple",
"mobile_number": "",
"dpi": "",
"url": "https://device.pcloudy.com/device_images/small/iPhoneSE.png",
"ram": 2048,
"resolution": "640x1136",
"display_area": 4,
"available": true
}
]
}
- Book Device API
Sample request
{
"token":"s85zmqdv3wfxgrp9x3btynbn ","devices":[783],"booking_duration": "30","automation_type": "XCUITest"}
Sample response
{
"result": "Devices are reserved successfully for the automation execution",
"statuscode": "200",
"data": {
"automationId": 440916
}
}
- Initialize Automation
Sample request
{ "token":"s85zmqdv3wfxgrp9x3btynbn","automationId": "440916","test_suite": "ArchiveXCTestPRod(1).zip"}
Sample response
{
"statuscode": 200,
"result": "Automation initiated successfully..."
}
- Start Device Services
EndPoint : {{URL}}/api/startdeviceservices
Sample request
{"token":"s85zmqdv3wfxgrp9x3btynbn","automationId": "440925","startDeviceLogs": "true","startPerformanceData": "true","startSessionRecording": "true"}
Sample response
{
"statuscode": 200,
"result": "Device logs started successfully,Performance data started successfully,Session video recording started successfully"
}
- Automation Report Shareable Link
EndPoint : {{URL}}/api/api/getAutomationShareableReportLink
This API helps to share the automation reports to team.
Change the format of shreable link to JSON format.
Sample request
{"token":"s85zmqdv3wfxgrp9x3btynbn","rid":"440925"}
Sample response
{
"result": {
"token": "s85zmqdv3wfxgrp9x3btynbn",
"shareableLink": "https://device.pcloudy.com/execution_report/0?key=j8z8qjfjxmwqvcby73k4fn8p"
}}
- Release Device This API helps you to release the XCTest automation devices.
EndPoint : {{URL}}/api/api/automationrelease
Sample request
{"token":"s85zmqdv3wfxgrp9x3btynbn","automationId": "440925"}
View test results After you start an XCUI test-suite execution visit your Reports section to view your test results Was this article helpful?
Did this page help you?