{
    "description": {
        "author": "Salesforce",
        "text": [
            "Selector: **/XCUIElementTypeOther[$type == 'XCUIElementTypeNavigationBar' AND name == 'Create Post'$][1].",
            "Represents the iOS modal for posting in Chatter.",
            "Input text to post and publish."
        ]
    },
    "implements": "utam-salesforceapp/pageObjects/chatter/postPublisher",
    "root": true,
    "platform": "native",
    "profile": [
        {
            "platform": [
                "ios_phone",
                "ios_tablet"
            ]
        }
    ],
    "selector": {
        "classchain": "**/XCUIElementTypeOther[$type == 'XCUIElementTypeNavigationBar' AND name == 'Create Post'$][1]"
    },
    "elements": [
        {
            "name": "inputText",
            "type": [
                "clickable",
                "editable"
            ],
            "selector": {
                "accessid": "publisher.textEntry"
            }
        },
        {
            "name": "postButton",
            "type": [
                "clickable"
            ],
            "selector": {
                "accessid": "publisher.postButton"
            }
        },
        {
            "name": "button",
            "type": [
                "clickable"
            ],
            "selector": {
                "classchain": "**/XCUIElementTypeCell[$type = 'XCUIElementTypeStaticText' AND name CONTAINS '%s'$]",
                "args": [
                    {
                        "name": "text",
                        "type": "string"
                    }
                ]
            }
        }
    ],
    "methods": [
        {
            "name": "typeText",
            "compose": [
                {
                    "element": "inputText",
                    "apply": "setText",
                    "args": [
                        {
                            "name": "textToType",
                            "type": "string"
                        }
                    ]
                }
            ]
        },
        {
            "name": "clickPostButton",
            "compose": [
                {
                    "element": "postButton",
                    "apply": "click"
                },
                {
                    "element": "root",
                    "apply": "waitFor",
                    "args": [
                        {
                            "type": "function",
                            "predicate": [
                                {
                                    "element": "root",
                                    "apply": "containsElement",
                                    "args": [
                                        {
                                            "type": "locator",
                                            "value": {
                                                "accessid": "publisher.postButton"
                                            }
                                        }
                                    ],
                                    "matcher": {
                                        "type": "isFalse"
                                    }
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "name": "clickButtonWithText",
            "compose": [
                {
                    "element": "button",
                    "apply": "click"
                }
            ]
        }
    ]
}