{
    "description": {
        "author": "Salesforce",
        "text": [
            "Selector: XCUIElementTypeScrollView[$name == \"briefcase_status\"$].",
            "Represents the iOS Briefcase view.",
            "Verify the downloaded objects."
        ]
    },
    "implements": "utam-salesforceapp/pageObjects/offlineapp/briefcase",
    "root": true,
    "exposeRootElement": true,
    "platform": "native",
    "profile": [
        {
            "platform": [
                "ios_phone",
                "ios_tablet"
            ]
        }
    ],
    "selector": {
        "classchain": "**/XCUIElementTypeScrollView[$name == \"briefcase_status\"$]"
    },
    "beforeLoad": [
        {
            "apply": "waitFor",
            "args": [
                {
                    "type": "function",
                    "predicate": [
                        {
                            "element": "root",
                            "apply": "isPresent"
                        },
                        {
                            "element": "root",
                            "apply": "containsElement",
                            "args": [
                                {
                                    "type": "locator",
                                    "value": {
                                        "accessid": "briefcase_objectsList"
                                    }
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "elements": [
        {
            "name": "status",
            "selector": {
                "accessid": "briefcase_status"
            }
        },
        {
            "name": "lastUpdate",
            "selector": {
                "accessid": "last_updated_text"
            }
        },
        {
            "name": "objectList",
            "public": true,
            "type": "utam-salesforceapp/pageObjects/offlineapp/offlineObjectList",
            "selector": {
                "accessid": "briefcase_objectsList"
            }
        },
        {
            "name": "draftSummary",
            "type": "utam-salesforceapp/pageObjects/offlineapp/draftSummary",
            "public": true,
            "selector": {
                "accessid": "draft_status"
            }
        },
        {
            "name": "searchField",
            "selector": {
                "accessid": "search_field"
            },
            "type": [
                "clickable"
            ]
        }
    ],
    "methods": [
        {
            "name": "getStatus",
            "compose": [
                {
                    "element": "status",
                    "apply": "getText"
                }
            ]
        },
        {
            "name": "getLastUpdate",
            "compose": [
                {
                    "element": "lastUpdate",
                    "apply": "getText"
                }
            ]
        },
        {
            "name": "hasDraftSummary",
            "compose": [
                {
                    "element": "root",
                    "apply": "containsElement",
                    "args": [
                        {
                            "type": "locator",
                            "value": {
                                "accessid": "draft_status"
                            }
                        }
                    ]
                }
            ]
        },
        {
            "name": "hasBriefcaseSearch",
            "compose": [
                {
                    "returnType": "boolean",
                    "element": "searchField",
                    "matcher": {
                        "type": "notNull"
                    }
                }
            ]
        },
        {
            "name": "clickSearch",
            "compose": [
                {
                    "element": "searchField",
                    "apply": "click"
                }
            ]
        }
    ]
}