{
    "description": {
        "author": "Salesforce",
        "text": [
            "Selector: runtime_sales_easy-text-picker",
            "Text Picker popup for editing button label and URL.",
            "Backed by lightning-popup; provides inputs for text and link and Save/Cancel actions."
        ]
    },
    "root": true,
    "selector": {
        "css": "runtime_sales_easy-text-picker"
    },
    "beforeLoad": [
        {
            "apply": "waitFor",
            "args": [
                {
                    "type": "function",
                    "predicate": [
                        {
                            "element": "root",
                            "apply": "containsElement",
                            "args": [
                                {
                                    "type": "locator",
                                    "value": {
                                        "css": "lightning-popup"
                                    }
                                },
                                {
                                    "value": true
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "shadow": {
        "elements": [
            {
                "name": "lightningPopup",
                "selector": {
                    "css": "lightning-popup"
                },
                "public": true,
                "elements": [
                    {
                        "name": "popover",
                        "selector": {
                            "css": ".slds-popover"
                        },
                        "public": true,
                        "elements": [
                            {
                                "name": "header",
                                "selector": {
                                    "css": ".slds-popover__header"
                                },
                                "public": true
                            },
                            {
                                "name": "body",
                                "selector": {
                                    "css": ".slds-popover__body"
                                },
                                "public": true,
                                "elements": [
                                    {
                                        "name": "textInput",
                                        "selector": {
                                            "css": "lightning-input.link-text"
                                        },
                                        "type": "utam-lightning/pageObjects/input",
                                        "public": true
                                    },
                                    {
                                        "name": "linkInput",
                                        "selector": {
                                            "css": "lightning-input.link-url"
                                        },
                                        "type": "utam-lightning/pageObjects/input",
                                        "public": true
                                    }
                                ]
                            },
                            {
                                "name": "footer",
                                "selector": {
                                    "css": ".slds-popover__footer"
                                },
                                "public": true,
                                "elements": [
                                    {
                                        "name": "saveButton",
                                        "selector": {
                                            "css": "lightning-button.popup-save"
                                        },
                                        "type": "clickable",
                                        "public": true
                                    },
                                    {
                                        "name": "cancelButton",
                                        "selector": {
                                            "css": "lightning-button.popup-cancel"
                                        },
                                        "type": "clickable",
                                        "public": true
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "methods": [
        {
            "name": "waitForPopup",
            "compose": [
                {
                    "apply": "waitFor",
                    "args": [
                        {
                            "type": "function",
                            "predicate": [
                                {
                                    "element": "lightningPopup"
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "name": "setText",
            "args": [
                {
                    "name": "value",
                    "type": "string"
                }
            ],
            "compose": [
                {
                    "apply": "waitFor",
                    "args": [
                        {
                            "type": "function",
                            "predicate": [
                                {
                                    "element": "textInput"
                                }
                            ]
                        }
                    ]
                },
                {
                    "apply": "setText",
                    "element": "textInput",
                    "args": [
                        {
                            "name": "value",
                            "type": "string"
                        }
                    ]
                }
            ]
        },
        {
            "name": "setLink",
            "args": [
                {
                    "name": "value",
                    "type": "string"
                }
            ],
            "compose": [
                {
                    "apply": "waitFor",
                    "args": [
                        {
                            "type": "function",
                            "predicate": [
                                {
                                    "element": "linkInput"
                                }
                            ]
                        }
                    ]
                },
                {
                    "apply": "setText",
                    "element": "linkInput",
                    "args": [
                        {
                            "name": "value",
                            "type": "string"
                        }
                    ]
                }
            ]
        },
        {
            "name": "clickSave",
            "compose": [
                {
                    "apply": "waitFor",
                    "args": [
                        {
                            "type": "function",
                            "predicate": [
                                {
                                    "element": "saveButton"
                                }
                            ]
                        }
                    ]
                },
                {
                    "apply": "click",
                    "element": "saveButton"
                }
            ]
        },
        {
            "name": "clickCancel",
            "compose": [
                {
                    "apply": "waitFor",
                    "args": [
                        {
                            "type": "function",
                            "predicate": [
                                {
                                    "element": "cancelButton"
                                }
                            ]
                        }
                    ]
                },
                {
                    "apply": "click",
                    "element": "cancelButton"
                }
            ]
        }
    ]
}