{
    "description": {
        "author": "Salesforce",
        "text": [
            "Selector: search.global.results.mru, stageleft.tableview, or table.itemList.",
            "Represents the iOS generic item list.",
            "Check for an item in the list and navigate to it."
        ]
    },
    "implements": "utam-salesforceapp/pageObjects/navigation/navItemsList",
    "platform": "native",
    "profile": [
        {
            "platform": [
                "ios_phone",
                "ios_tablet"
            ]
        }
    ],
    "beforeLoad": [
        {
            "apply": "waitFor",
            "args": [
                {
                    "type": "function",
                    "predicate": [
                        {
                            "element": "root",
                            "apply": "isPresent"
                        }
                    ]
                }
            ]
        }
    ],
    "exposeRootElement": true,
    "type": [
        "actionable",
        "touchable"
    ],
    "elements": [
        {
            "name": "visibleNavItems",
            "type": [
                "clickable",
                "actionable"
            ],
            "public": true,
            "selector": {
                "classchain": "**/XCUIElementTypeStaticText[`visible == true`]",
                "returnAll": true
            }
        },
        {
            "name": "navItemWithLabel",
            "type": [
                "clickable",
                "actionable"
            ],
            "nullable": true,
            "selector": {
                "classchain": "**/XCUIElementTypeStaticText[`label == '%s'`]",
                "args": [
                    {
                        "name": "label",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "visibleNavItemWithLabel",
            "type": [
                "clickable",
                "actionable"
            ],
            "nullable": true,
            "public": true,
            "selector": {
                "classchain": "**/XCUIElementTypeStaticText[`visible == true AND label == '%s'`]",
                "args": [
                    {
                        "name": "label",
                        "type": "string"
                    }
                ]
            }
        }
    ],
    "methods": [
        {
            "name": "hasNavItemWithLabel",
            "compose": [
                {
                    "returnType": "boolean",
                    "element": "navItemWithLabel",
                    "matcher": {
                        "type": "notNull"
                    }
                }
            ]
        },
        {
            "name": "clickNavItemWithLabel",
            "compose": [
                {
                    "applyExternal": {
                        "type": "utam-salesforceapp/utils/navigation/navItemsListiOSUtils",
                        "invoke": "clickNavItem",
                        "args": [
                            {
                                "name": "itemLabel",
                                "type": "string"
                            }
                        ]
                    }
                }
            ]
        },
        {
            "name": "pullToRefresh",
            "compose": [
                {
                    "element": "root",
                    "apply": "flick",
                    "args": [
                        {
                            "value": 0
                        },
                        {
                            "value": 400
                        }
                    ]
                }
            ]
        }
    ]
}