{
    "description": {
        "author": "Salesforce",
        "text": [
            "Selector: finderListView.",
            "Represents the iOS view for the Einstein analytics dashboard.",
            "Verify the dashboard and text widget label are loaded, and verify link action navigation."
        ]
    },
    "implements": "utam-salesforceapp/pageObjects/record/analyticsDashboard",
    "platform": "native",
    "profile": [
        {
            "platform": [
                "ios_phone",
                "ios_tablet"
            ]
        }
    ],
    "root": true,
    "selector": {
        "accessid": "ChatterWindow"
    },
    "beforeLoad": [
        {
            "apply": "waitFor",
            "args": [
                {
                    "type": "function",
                    "predicate": [
                        {
                            "element": "root",
                            "apply": "containsElement",
                            "args": [
                                {
                                    "type": "locator",
                                    "value": {
                                        "accessid": "crmaLoadingIndicator"
                                    }
                                }
                            ],
                            "matcher": {
                                "type": "isFalse"
                            }
                        }
                    ]
                }
            ]
        }
    ],
    "elements": [
        {
            "name": "pageNavigator",
            "type": [
                "clickable"
            ],
            "selector": {
                "accessid": "navigation_1"
            }
        },
        {
            "name": "brokenWidget",
            "type": [
                "actionable"
            ],
            "selector": {
                "accessid": "SEAWidgetErrorView"
            },
            "nullable": true
        },
        {
            "name": "dashboardTitle",
            "type": [
                "clickable"
            ],
            "selector": {
                "accessid": "navigationBar.titleView.titleLabel"
            }
        },
        {
            "name": "textWidgetByLabel",
            "type": [
                "clickable",
                "actionable"
            ],
            "selector": {
                "classchain": "**/XCUIElementTypeStaticOther[`label == '%s'`]",
                "args": [
                    {
                        "name": "label",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "table",
            "type": [
                "clickable"
            ],
            "selector": {
                "classchain": "**/XCUIElementTypeImage[`label == 'table'`]"
            }
        },
        {
            "name": "tableCellByLabel",
            "type": [
                "clickable"
            ],
            "selector": {
                "classchain": "**/XCUIElementTypeCell/**/XCUIElementTypeStaticText[`label == '%s'`]",
                "args": [
                    {
                        "name": "label",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "linkWidgetByLabel",
            "type": [
                "clickable"
            ],
            "selector": {
                "classchain": "**/XCUIElementTypeLink[`label == '%s'`]",
                "args": [
                    {
                        "name": "label",
                        "type": "string"
                    }
                ]
            }
        }
    ],
    "methods": [
        {
            "name": "switchTab",
            "compose": [
                {
                    "element": "pageNavigator",
                    "apply": "click"
                }
            ]
        },
        {
            "name": "hasBrokenWidgets",
            "compose": [
                {
                    "returnType": "boolean",
                    "element": "brokenWidget",
                    "matcher": {
                        "type": "notNull"
                    }
                }
            ]
        },
        {
            "name": "getDashboardTitle",
            "compose": [
                {
                    "element": "dashboardTitle",
                    "apply": "getText"
                }
            ]
        },
        {
            "name": "hasTextWidgetWithLabel",
            "compose": [
                {
                    "returnType": "boolean",
                    "element": "textWidgetByLabel",
                    "matcher": {
                        "type": "notNull"
                    }
                }
            ]
        },
        {
            "name": "clickTable",
            "compose": [
                {
                    "element": "table",
                    "apply": "click"
                }
            ]
        },
        {
            "name": "clickTableCellWithLabel",
            "compose": [
                {
                    "element": "tableCellByLabel",
                    "apply": "click"
                }
            ]
        },
        {
            "name": "clickLinkWidgetWithLabel",
            "compose": [
                {
                    "element": "linkWidgetByLabel",
                    "apply": "click"
                }
            ]
        }
    ]
}