{
    "description": {
        "author": "Salesforce",
        "text": [
            "Selector: resourceId(\"com.salesforce.chatter:id/ui_common__toolbar_container\").",
            "Represents the Android toolbar at the top of the tabbed activity.",
            "Access the profile menu, load notifications, search, toggle favorite, or toggle overflow."
        ]
    },
    "implements": "utam-salesforceapp/pageObjects/navigation/navBar",
    "root": true,
    "type": [
        "actionable"
    ],
    "platform": "native",
    "profile": [
        {
            "platform": [
                "android_phone",
                "android_tablet"
            ]
        }
    ],
    "beforeLoad": [
        {
            "apply": "waitFor",
            "args": [
                {
                    "type": "function",
                    "predicate": [
                        {
                            "element": "root",
                            "apply": "isPresent"
                        }
                    ]
                }
            ]
        }
    ],
    "selector": {
        "uiautomator": "resourceId(\"com.salesforce.chatter:id/ui_common__toolbar_container\")"
    },
    "elements": [
        {
            "name": "profileIcon",
            "nullable": true,
            "selector": {
                "uiautomator": "resourceId(\"com.salesforce.chatter:id/user_avatar_icon\")"
            },
            "type": [
                "clickable"
            ]
        },
        {
            "name": "favoriteIcon",
            "nullable": false,
            "selector": {
                "uiautomator": "resourceId(\"NotSupported-Call-openOverflow-AndUse-navBarOverflowMenu-InsteadForAndroid\")"
            },
            "type": [
                "clickable"
            ]
        },
        {
            "name": "icon",
            "selector": {
                "uiautomator": "className(\"android.widget.ImageView\").text(\"%s\")",
                "args": [
                    {
                        "name": "label",
                        "type": "string"
                    }
                ]
            },
            "type": [
                "clickable"
            ]
        },
        {
            "name": "titleText",
            "type": [
                "clickable",
                "actionable"
            ],
            "selector": {
                "uiautomator": "resourceId(\"com.salesforce.chatter:id/bottom_title\")"
            }
        },
        {
            "name": "notificationIcon",
            "selector": {
                "uiautomator": "resourceId(\"com.salesforce.chatter:id/mi_notification\")"
            },
            "type": [
                "clickable"
            ]
        },
        {
            "name": "searchIcon",
            "selector": {
                "uiautomator": "resourceId(\"com.salesforce.chatter:id/mi_search\")"
            },
            "type": [
                "clickable"
            ]
        },
        {
            "name": "newButton",
            "nullable": true,
            "selector": {
                "uiautomator": "resourceId(\"com.salesforce.chatter:id/object_list_new_button\")"
            },
            "type": [
                "clickable"
            ]
        },
        {
            "name": "overflowButton",
            "nullable": true,
            "selector": {
                "accessid": "More options"
            },
            "type": [
                "clickable"
            ]
        },
        {
            "name": "shareIcon",
            "selector": {
                "uiautomator": "className(\"android.widget.Button\").description(\"Share\")"
            },
            "type": [
                "clickable"
            ]
        }
    ],
    "methods": [
        {
            "name": "clickProfile",
            "compose": [
                {
                    "element": "profileIcon",
                    "apply": "click"
                }
            ]
        },
        {
            "name": "openSearch",
            "compose": [
                {
                    "element": "searchIcon",
                    "apply": "click"
                }
            ]
        },
        {
            "name": "openNotifications",
            "compose": [
                {
                    "element": "notificationIcon",
                    "apply": "click"
                }
            ]
        },
        {
            "name": "clickItem",
            "compose": [
                {
                    "element": "icon",
                    "apply": "click"
                }
            ]
        },
        {
            "name": "clickNew",
            "compose": [
                {
                    "element": "newButton",
                    "apply": "click"
                }
            ]
        },
        {
            "name": "clickShare",
            "compose": [
                {
                    "element": "shareIcon",
                    "apply": "click"
                }
            ]
        },
        {
            "name": "getTitleText",
            "compose": [
                {
                    "element": "titleText",
                    "apply": "getText"
                }
            ]
        },
        {
            "name": "toggleFavorite",
            "compose": [
                {
                    "element": "root",
                    "apply": "focus"
                }
            ]
        },
        {
            "name": "waitForIsFavorite",
            "compose": [
                {
                    "element": "favoriteIcon",
                    "apply": "isPresent"
                }
            ]
        },
        {
            "name": "waitForIsNotFavorite",
            "compose": [
                {
                    "element": "favoriteIcon",
                    "apply": "isPresent"
                }
            ]
        },
        {
            "name": "openOverflow",
            "compose": [
                {
                    "element": "overflowButton",
                    "apply": "click"
                }
            ]
        }
    ]
}