콘텐츠로 건너뛰기

문서

  • 언어
    • 한국어 – KO
    • English – EN
  • 언어
    • 한국어 – KO
    • English – EN

시나리오 작성하기

  • Stego란?
  • 기본기능
  • 시나리오 작성과 실행
  • 액션 목록
  • 화면 분석 도구 목록

시나리오 작성 튜토리얼

  • 1. 앱 실행하기
  • 2. 스크롤해서 아이템 찾기
  • 3. 특정 위치 단어 확인
  • 4. 구글맵 확대하기
  • 5. 조건문 액션 사용하기
  • 6. 재생중인 동영상 정지하기
  • 7. 알람 시간 설정하기
  • 8. 사라지는 UI 확인하기
  • 9. 바탕화면 아이콘 검사하기
  • 10. 공유 시나리오 사용하기

Apptest.ai에서 Stego 시나리오 실행하기

  • 시나리오 테스트하기

로그인 및 프로젝트,팀 관리

  • 로그인하기
  • 프로젝트 만들기
  • 팀 만들기

자율 탐색 테스트 시작하기

  • 모바일 앱테스트하기
  • 웹페이지 테스트하기

테스트 결과 확인하기

  • Summary
  • Activity Map
  • Screen
  • Performance
  • Device Log
  • 테스트 결과 공유하기

통합 및 API

  • Jenkins
  • Rest API’s

IPTV 셋톱박스 전용

  • 장비 등록하기
  • 화면 조작하기
  • 리모컨으로 시나리오 작성하기
  • 특수한 액션을 사용해서 시나리오 작성하기
  • Home
  • Rest API’s

Rest API’s

Table of Contents
  • Integrating REST APIs into CI / CD pipelines
    • 1. [POST] Run New Testset
    • 2. [ GET ] Testset Status
    • 3. [ GET ] Testset Result
    • 4. [ GET ] List of Scenario IDs
    • Appendix. API Result Codes

Integrating REST APIs into CI / CD pipelines #

CI (Continuous Integration) 도구과 연동하여 apptest.ai를 사용하기위한 API 정보를 제공합니다. 해당 문서에서 제공되는 테스트시작, 테스트 상태 보기, 테스트 결과 조회 API를 통해 apptest.ai를 사용하실 수 있습니다.

 

1. [POST] Run New Testset #

새로운 테스트 세트를 생성합니다. (테스트 세트는 단위 테스트들의 집합입니다.) 새로운 테스트기 실행될때 사용되는 일부 옵션들은 프로젝트에 미리 저장해놓은 설정 정보를 따릅니다. [Request]

POST /openapi/v2/testset

Host : https://api.apptest.ai

Authorization : Basic {user_id}:{access_key}

Request Body Multipart Form Data #1

Key Type Description Required
app_file File 테스트할 대상 앱 파일 자율탐색 테스트 전용 Yes

Request Body Multipart Form Data #2

Key   Type   Description Required
pid   Positive Number – 프로젝트의 고유번호 ex) 509 Yes
testset_name   String Max 100 Characters 테스트 세트의 이름 ex) “Testset name Example#1” Yes
os_type   String ANDROID | iOS 테스트 대상의 OS 타입 ex) “ANDROID” Yes
scenario_id   Number 0 | Positive Automated test는 0 (기본값). 그 외는 시나리오 고유 번호. ex) 509 No
source_type   String file | app_id 현재, 시나리오테스트 전용 테스트 대상의 종류 (앱 파일 또는 앱 아이디) 프로젝트의 앱 저장소에 설정된 대상의 종류 Yes
time_limit   Positive Number Min : 5 Max : 30 테스트 제한시간 (분) ex) 5 테스트 시간 제한이 비어 있으면, 프로젝트 설정에 저장된 시간 제한을 따릅니다. No
use_vo   Boolean Default: false Automated test 전용 Whether AT&T Video Optimizer(ARO) is used ( true | false ) ex) true No
callback   String Max 250 characters 테스트가 완료될 경우 호출될 Callback URL ex) ‘https://127.0.0.1/callback/url/example’ No
credentials login_id String Max 150 Characters 앱을 테스트하는데 사용될 테스트 대상 앱의 계정정보(아이디) (Test credentials info – Login ID) ex) ’test@gmail.com’, ‘01012345678’, ’testaccount’ No
  login_pw String Max 150 Characters 앱을 테스트하는데 사용될 테스트 대상앱의 계정정보(비밀번호) (Test credentials info – Login PW) ex) ‘password1234!’ No

[ Request Example #1 – Automated Test]

curl    --request POST \
        --user {user_id}:{access_key} \
        -F 'app_file=@/path/of/your/app_file' \
        -F 'data={\
            "pid": 509, \
            "testset_name": "Testset Name Example #1", \
            "os_type": "ANDROID", \
            "time_limit": 15, \
            "use_vo": false, \
            "credentials": { \
                "login_id": "test@gmail.com", \
                "login_pw": "password1234!" \
            } \
        }' https://api.apptest.ai/openapi/v2/testset

[ Request Example #2 – Scenario Test]

curl    --request POST \
        --user {user_id}:{access_key} \
        -F 'data={\
            "pid": 509, \
            "testset_name": "Testset Name Example #1", \
            "os_type": "ANDROID", \
            "scenario_id": 1204, \
            "source_type": "file", \
            "time_limit": 15, \
        }' https://api.apptest.ai/openapi/v2/testset

[ Response ]

Key Type Description
test_count Positive Number 테스트 세트에 실행된 단일 테스트의 개수 ex) 3
testset_id Positive Number 테스트 세트의 고유번호 ex) 251929

[ Response Example ]

{
  "data": {
    "test_count": 1,
    "testset_id": 251929
  },
  "result_code": 0,
  "result_msg": "",
  "reason": ""
}

[ Error Code ]

result_code result_msg reason
4000 Missing Request Parameter The required parameter was not found in the request parameters : {{ PARAMETER KEY }}
4030 App File Analysis Failed iOS plistlib Parsing Error : {{ PARSING ERROR MSG }}
4031   Test creation failed : There was a problem pre-processing your app file. The IPA file must be a development version that is signed by your development certificate.
4032   Test creation failed. Invalid app file. There was a problem pre-processing your app file.
4040   Android Manifest Parsing Error : {{ PARSING ERROR MSG }}
4041   No launchable activity found. (android.intent.category.LAUNCHER)
4050 Invalid Request Parameter File extension not supported. ( Support : ipa, zip, app, apk, xapk, apks )
4051   The required parameter was not found in the request parameters : (app_file)
4052   Invalid request parameter : (project_id: {{ PROJECT_ID }})
4053   Invalid request parameter : (testset_id: {{ TESTSET_ID }})
4055   Device is not compatible with this app : ( APP os type : {{ APP_OS_TYPE }} )
4080 Invalid Request Parameter Device info does not exist in preset project data.
4081   Available devices don’t exist in preset project data.
5001 Run New Testset Error Global Exception Error – {{ ERROR_MSG }}
6001 App File Upload Error App file upload failed.
8000 System Maintenance The service is currently under system maintenance.

 

2. [ GET ] Testset Status #

테스트 세트의 진행상황 확인

[ Request ]

GET /openapi/v2/testset/{testset_id}

Host : https://api.apptest.ai

Authorization : Basic {user_id}:{access_key}

Request URL Parameter

Key Type Description Required
testset_id Positive number 테스트 세트의 고유 번호 Yes

[ Request Example ]

curl --request GET \
     --user {user_id}:{access_key} \
     https://api.apptest.ai/openapi/v2/testset/55716

[ Response ]

Response Body Data Type : JSON

Key   Type Description
testset_status   String 테스트 세트의 진행 상태 ( Complete, Running )
testset_status_detail   JSON 테스트의 상태별 개수
  total_test_cnt Positive number 전체 단일 테스트 개수
  error_cnt Positive number 에러가 발생된 단일 테스트의 개수
  fail_cnt Positive number 실패한 단일 테스트의 개수
  initializing_cnt Positive number 준비단계의 단일 테스트 개수
  pass_cnt Positive number 정상종료된 단일 테스트의 개수
  running_cnt Positive number 테스트가 진행중인 단일테스트의 개수
  stop_cnt Positive number 사용자에 의해 중지된 단일 테스트의 개수
response_time   Datetime 응답 시간 (timezone : UTC)

[Response Example ]

{
  "data": {
    "testset_status": "Complete",
    "testset_status_detail": {
      "total_test_cnt": 3,
      "error_cnt": 1,
      "fail_cnt": 1,
      "initializing_cnt": 0,
      "running_cnt": 1,
      "stop_cnt": 0,
      "pass_cnt": 0
    },
    "response_time": "Mon, 25 May 2020 06:40:24 GMT"
  },
  "result_code": 0,
  "result_msg": "",
  "reason": ""
}

[ Error Code ]

result_code result_msg reason
5002 Get Testset Status Error Global Exception Error – {ERROR_MSG}
8000 System Maintenance

The Service is currently under system maintenance.

 

3. [ GET ] Testset Result #

테스트가 완료되었을 경우에만 호출이 가능한 API 입니다. 테스트 세트의 결과 데이터를 조회합니다.

[ Request ]

GET /openapi/v2/testset/{testset_id}/result

Host : https://api.apptest.ai

Authorization : Basic {user_id}:{access_key}

Request URL Parameter

Key Type Description Required
testset_id Positive number 테스트 세트의 고유번호 Yes

Request Query Parameter

Key Type Description Required
data_type String Test result data type (all | xml | bare_xml | json | html) Default : all ex) https://api.apptest.ai/openapi/v2/testset/{testset_id}/result?data_type=all No
[ Request Example ]

curl --request GET \
     --user {user_id}:{access_key} \
     https://api.apptest.ai/openapi/v2/testset/55716/result
curl --request GET \
     --user {user_id}:{access_key} \
     https://api.apptest.ai/openapi/v2/testset/55716/result?data_type=xml
[ Response ] Response Body Data Type : JSON

Key Type Description
complete Boolean 테스트가 진행중인지 종료 되었는지에 대한 여부 ( true | false)
result_xml Boolean JUnit형식의 XML 결과 데이터
result_bare_xml Boolean Result data in XML format in JUnit format Exclude “?xml” and “testsuites” tag 여러 테스트를 한번에 실행하는 경우 사용
result_html Boolean HTML형식의 결과 데이터
result_json Boolean JUnit 형식의 Json 결과 데이터
[ JUnit XML Format ]

Key Type Description
testsuite name apptest.ai’s 프로젝트 이름
testcase name 테스트 장치 이름 (Unit Test)
  time Time the test was performed
system-out   테스트 결과 링크
error message 오류가 발견된 테스트 결과 링크
[ JUnit XML Format Example ]

<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="TestBot Test">
    <testsuite name="{PROJECT NAME}.TestBot">
        <testcase name="{DEVICE NAME}" time="{TEST TIME SECONDS}">
            <system-out>{RESULT PAGE LINK URL}</system-out>
        </testcase>
        <testcase name="{DEVICE NAME}" time="{TEST TIME SECONDS}">
            <error message="{RESULT PAGE LINK URL}" />
        </testcase>
    </testsuite>
</testsuites>
[ Error Code ]

result_code result_msg reason
5003 Get Testset Result Data Error Global Exception Error – {ERROR_MSG}
6002 Get Testset Result Data Failed Test is running yet. Please request when the test is complete.
6003 Data Does Not Exist Test data does not exist.
8000 System Maintenance The Service is currently under system maintenance.

 

4. [ GET ] List of Scenario IDs #

시나리오 테스트 실행 시 사용될 시나리오 정보를 조회하기 위한 API 입니다.

[ Request ]

GET /openapi/v2/project/{project_id}/scenarios

Host : https://api.apptest.ai

Authorization : Basic {user_id}:{access_key}

Request URL Parameter

Key Type Description Required
project_id Positive number 프로젝트 고유번호 Yes

Request Query Parameter

Key Type Description Required
os_type String 시나리오 등록시 선택한 os type 정보 ( ANDROID | iOS )
ex) https://api.apptest.ai/openapi/v2/project/{project_id}/scenarios?os_type=ANDROID
No
q String 시나리오 이름에 해당 문자열이 포함된 목록을 조회
ex) https://api.apptest.ai/openapi/v2/project/{project_id}/scenarios?q=login
No

[ Request Example ]

curl --request GET \
     --user {user_id}:{access_key} \
     https://api.apptest.ai/openapi/v2/project/2019/scenarios?os_type=ANDROID&q=login_fail

[ Response ]

Response Body Data Type : JSON

Key Type Description
scenarios Array 시나리오 아이디 목록
response_time Datetime 응답 시간 (timezone: UTC)

[ Response Example ]

{
  "data": {
    "scenarios": [1204, 1206],
    "response_time": "Mon, 25 May 2020 06:40:24 GMT"
  },
  "result_code": 0,
  "result_msg": 0,
  "reason": ""
}

[ Error Code ]

result_code result_msg reason
2001 Get Project Data Fail Project data does not exist
4051 Invalid request parameter Invalid request parameter : (project id)
5005 Get Scenario List Error Global Exception Error – {ERROR_MSG}
8000 System Maintenance The Service is currently under system maintenance.

Appendix. API Result Codes #

result_code result_msg reason
4000 Missing Request Parameter The required parameter was not found in the request parameters : ({PARAMETER KEY})
4030 App File Analysis Failed iOS plistlib Parsing Error : {PARSING ERROR MSG}
4031 App File Analysis Failed Test creation failed : There was a problem pre-processing your app file.
The IPA file must be a development version that is signed by your development certificate.
4032 App File Analysis Failed Test creation failed : Invalid app file.
There was a problem pre-processing your app file.
4040 App File Analysis Failed Android Manifest Parsing Error : {PARSING ERROR MSG}
4041 App File Analysis Failed No launchable activity found. (android.intent.category.LAUNCHER)
4050 Invalid Request Parameter File extension not supported. (support : ipa, zip, app, apk, xapk, apks)
4051 Invalid Request Parameter The required parameter was not found in the request parameters: (app_file)
4052 Invalid Request Parameter Invalid request parameter : (project_id : {PROJECT_ID})
4053 Invalid Request Parameter Invalid request parameter : (testset_id : {TESTSET_ID})
4055 Invalid Request Parameter Device is not compatible with this app : (App os type : {APP_OS_TYPE})
4080 Invalid Request Parameter Device info does not exist in preset project data.
4081 Invalid Request Parameter Available devices don’t exist in preset project data.
5001 Run New Testset Error Global Exception Error – {ERROR_MSG}
5002 Get Testset Status Error Global Exception Error – {ERROR_MSG}
5003 Get Testset Result Data Error Global Exception Error – {ERROR_MSG}
6001 App File Upload Error App file upload failed.
6002 Get Testset Result Data Failed Test is running yet. Please request when the test is complete.
6003 Data Does Not Exist Test data does not exist.
8000 System Maintenance The Service is currently under system maintenance.
도움이 더 필요하신가요?

의견 보내기

Updated on 26/12/2022
Jenkins
Table of Contents
  • Integrating REST APIs into CI / CD pipelines
    • 1. [POST] Run New Testset
    • 2. [ GET ] Testset Status
    • 3. [ GET ] Testset Result
    • 4. [ GET ] List of Scenario IDs
    • Appendix. API Result Codes