Skip to main content
🏠Documentation|XCTest

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

  1. User should be registered on Pcloudy platform.
  2. 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
  3. To download sample zip file click the link below.

ArchiveXCTestPRod(1).zip

  1. Upload the sample zip file in the MyData section manually or using API.
  2. Upload your iOS app (.ipa) file on the pCloudy platform using an API request. curl --location --request POST URL format:
Json
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

Json
Endpoint: request POST: {{URL}}/api/devices

Sample request

Json
{
"token": "jmxbd3jvrdt74nzcjc43ccth",
"duration": 15,
"platform": "ios",
"available_now": "true"
}

Sample response

Json
{
"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
}
]
}
  1. Book Device API

Sample request

Json

{
"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
}
}
  1. Initialize Automation

Sample request

Json
{ "token":"s85zmqdv3wfxgrp9x3btynbn","automationId": "440916","test_suite": "ArchiveXCTestPRod(1).zip"}

Sample response

Json
  {
"statuscode": 200,
"result": "Automation initiated successfully..."
}
  1. Start Device Services
Json
EndPoint : {{URL}}/api/startdeviceservices

Sample request

Json

{"token":"s85zmqdv3wfxgrp9x3btynbn","automationId": "440925","startDeviceLogs": "true","startPerformanceData": "true","startSessionRecording": "true"}

Sample response

Json

{
"statuscode": 200,
"result": "Device logs started successfully,Performance data started successfully,Session video recording started successfully"
}
  1. Automation Report Shareable Link
Json
EndPoint : {{URL}}/api/api/getAutomationShareableReportLink

This API helps to share the automation reports to team.

note

Change the format of shreable link to JSON format.

Sample request

Json
 {"token":"s85zmqdv3wfxgrp9x3btynbn","rid":"440925"}

Sample response

Json

{
"result": {
"token": "s85zmqdv3wfxgrp9x3btynbn",
"shareableLink": "https://device.pcloudy.com/execution_report/0?key=j8z8qjfjxmwqvcby73k4fn8p"
}}
  1. Release Device This API helps you to release the XCTest automation devices.
Json
EndPoint : {{URL}}/api/api/automationrelease    

Sample request

Json
{"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?