{
    "description": {
        "author": "Salesforce",
        "text": [
            "Selector: **/XCUIElementTypeTable[`name == 'mobileHomeTableView'`].",
            "Represents the iOS mobile home cards scrollview.",
            "Verify cards are present or navigate to one."
        ]
    },
    "implements": "utam-salesforceapp/pageObjects/mobilehome/homeCardList",
    "platform": "native",
    "profile": [
        {
            "platform": [
                "ios_phone",
                "ios_tablet"
            ]
        }
    ],
    "exposeRootElement": true,
    "type": [
        "actionable",
        "touchable"
    ],
    "elements": [
        {
            "name": "visibleCardBadges",
            "nullable": true,
            "type": [
                "clickable",
                "actionable"
            ],
            "selector": {
                "classchain": "**/XCUIElementTypeStaticText[`visible == true`]",
                "returnAll": true
            },
            "public": true
        },
        {
            "name": "cardBadgeWithLabel",
            "type": [
                "clickable",
                "actionable",
                "touchable"
            ],
            "nullable": true,
            "public": true,
            "selector": {
                "classchain": "**/XCUIElementTypeStaticText[`label == '%s'`]",
                "args": [
                    {
                        "name": "badgeLabel",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "visibleCardBadgeWithLabel",
            "type": [
                "clickable",
                "actionable",
                "touchable"
            ],
            "nullable": true,
            "public": true,
            "selector": {
                "classchain": "**/XCUIElementTypeStaticText[`visible == true AND label == '%s'`]",
                "args": [
                    {
                        "name": "badgeLabel",
                        "type": "string"
                    }
                ]
            }
        },
        {
            "name": "cardEditButton",
            "type": [
                "clickable",
                "actionable"
            ],
            "nullable": true,
            "selector": {
                "classchain": "**/XCUIElementTypeCell[`name CONTAINS '%s'`]/**/XCUIElementTypeButton[`label == 'Edit'`]",
                "args": [
                    {
                        "name": "badgeLabel",
                        "type": "string"
                    }
                ]
            }
        }
    ],
    "methods": [
        {
            "name": "hasCardWithBadgeLabel",
            "compose": [
                {
                    "returnType": "boolean",
                    "element": "cardBadgeWithLabel",
                    "matcher": {
                        "type": "notNull"
                    }
                }
            ]
        },
        {
            "name": "clickCardWithBadgeLabel",
            "compose": [
                {
                    "applyExternal": {
                        "type": "utam-salesforceapp/utils/mobilehome/homeCardListUtilsiOS",
                        "invoke": "clickCardBadgeWithLabel",
                        "args": [
                            {
                                "name": "badgeLabel",
                                "type": "string"
                            }
                        ]
                    }
                }
            ]
        },
        {
            "name": "flickToCardWithBadgeLabel",
            "compose": [
                {
                    "returnType": "string",
                    "applyExternal": {
                        "type": "utam-salesforceapp/utils/mobilehome/homeCardListUtilsiOS",
                        "invoke": "flickToBadgeToGetText",
                        "args": [
                            {
                                "name": "badgeLabel",
                                "type": "string"
                            }
                        ]
                    }
                }
            ]
        },
        {
            "name": "editCardWithBadgeLabel",
            "compose": [
                {
                    "element": "cardEditButton",
                    "apply": "click"
                }
            ]
        }
    ]
}