{
    "description": {
        "author": "Salesforce",
        "text": [
            "Selector: **/XCUIElementTypeOther[$type == 'XCUIElementTypeNavigationBar' AND name == 'Select Report'$][-1].",
            "Represents the iOS Reports search bar.",
            "Start a report search and select an item from search results."
        ]
    },
    "implements": "utam-salesforceapp/pageObjects/record/reportCardSearchBar",
    "root": true,
    "platform": "native",
    "profile": [
        {
            "platform": [
                "ios_phone",
                "ios_tablet"
            ]
        }
    ],
    "beforeLoad": [
        {
            "apply": "waitFor",
            "args": [
                {
                    "type": "function",
                    "predicate": [
                        {
                            "element": "root",
                            "apply": "isPresent"
                        }
                    ]
                }
            ]
        }
    ],
    "selector": {
        "classchain": "**/XCUIElementTypeOther[$type == 'XCUIElementTypeNavigationBar' AND name == 'Select Report'$][-1]"
    },
    "elements": [
        {
            "name": "searchBarReport",
            "type": [
                "clickable",
                "editable"
            ],
            "selector": {
                "classchain": "**/XCUIElementTypeSearchField[`label == 'Search Report...'`]"
            }
        },
        {
            "name": "selectSearchResult",
            "type": [
                "clickable",
                "actionable"
            ],
            "selector": {
                "accessid": "\"%s\"",
                "args": [
                    {
                        "name": "query",
                        "type": "string"
                    }
                ]
            }
        }
    ],
    "methods": [
        {
            "name": "populateSearchReport",
            "compose": [
                {
                    "element": "searchBarReport",
                    "apply": "clearAndType",
                    "args": [
                        {
                            "name": "reportName",
                            "type": "string"
                        }
                    ]
                }
            ]
        },
        {
            "name": "selectReportSearchResult",
            "compose": [
                {
                    "element": "selectSearchResult",
                    "apply": "click"
                }
            ]
        }
    ]
}