{
    "description": {
        "author": "Salesforce",
        "text": [
            "Represents the page a user sees when opening a WorkOrder.",
            "Exposes methods for accessing related lists and details on a WorkOrder."
        ]
    },
    "implements": "utam-sfsmobileapp/pageObjects/record/workOrderObject",
    "root": true,
    "platform": "native",
    "beforeLoad": [
        {
            "apply": "waitFor",
            "args": [
                {
                    "type": "function",
                    "predicate": [
                        {
                            "element": "root",
                            "apply": "containsElement",
                            "args": [
                                {
                                    "value": {
                                        "accessid": "WORK ORDER"
                                    },
                                    "type": "locator"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "exposeRootElement": true,
    "type": [
        "actionable",
        "touchable"
    ],
    "profile": [
        {
            "platform": [
                "android_phone",
                "android_tablet"
            ]
        }
    ],
    "selector": {
        "uiautomator": "resourceId(\"com.salesforce.fieldservice.app:id/activity_tab_host\")"
    },
    "elements": [
        {
            "name": "assetServiceHistorySectionLabel",
            "type": [
                "clickable",
                "actionable"
            ],
            "selector": {
                "uiautomator": "new UiScrollable(new UiSelector().scrollable(true)).scrollIntoView(resourceId(\"com.salesforce.fieldservice.app:id/related_list_subtitle\").text(\"%s\"))",
                "args": [
                    {
                        "name": "label",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "visibleCards",
            "type": [
                "clickable",
                "actionable"
            ],
            "public": true,
            "selector": {
                "uiautomator": "resourceId(\"com.salesforce.fieldservice.app:id/main_content\")",
                "returnAll": true
            }
        },
        {
            "name": "myCard",
            "type": [
                "clickable"
            ],
            "selector": {
                "uiautomator": "resourceId('com.salesforce.fieldservice.app:id/%s_card_recycler_view')",
                "args": [
                    {
                        "name": "label",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "contactCard",
            "type": [
                "clickable"
            ],
            "selector": {
                "uiautomator": "resourceId(\"com.salesforce.fieldservice.app:id/contact_title\")"
            }
        },
        {
            "name": "workOrderObjectOverview",
            "type": "utam-sfsmobileapp/pageObjects/record/workOrderObjectOverview",
            "selector": {
                "accessid": "WORK ORDER"
            },
            "public": true
        }
    ],
    "methods": [
        {
            "name": "getAssetServiceHistorySection",
            "compose": [
                {
                    "element": "assetServiceHistorySectionLabel",
                    "apply": "click"
                }
            ]
        },
        {
            "name": "getAssetCard",
            "compose": [
                {
                    "applyExternal": {
                        "type": "utam-sfsmobileapp/utils/record/WorkOrderObjectAndroidUtils",
                        "invoke": "scroll"
                    }
                }
            ]
        },
        {
            "name": "hasCardVisible",
            "compose": [
                {
                    "element": "myCard",
                    "apply": "isPresent"
                }
            ]
        },
        {
            "name": "hasContactCardVisible",
            "compose": [
                {
                    "element": "contactCard",
                    "apply": "isPresent"
                }
            ]
        }
    ]
}