"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OjCollapsible = void 0;
const selenium_webdriver_1 = require("selenium-webdriver");
const OjCollapsibleBase_1 = require("./OjCollapsibleBase");
/**
 * The component WebElement for [oj-collapsible](../../jsdocs/oj.ojCollapsible.html).
 * Do not instantiate this class directly, instead, use
 * [ojCollapsible](../functions/elements.ojCollapsible-1.html).
 */
class OjCollapsible extends OjCollapsibleBase_1.OjCollapsibleBase {
    /**
     * Expand the oj-collapsible. If the component is collapsed, this method will
     * expand it. If it's already expanded, this method will do nothing.
     */
    async doExpand() {
        const expanded = await this.getExpanded();
        if (!expanded) {
            let icon = await this.findElement(selenium_webdriver_1.By.css('a.oj-collapsible-header-icon'));
            await icon.click();
        }
    }
    /**
     * Collapse the oj-collapsible. If the component is expanded, this method will
     * collapse it. If it's already collapsed, this method will do nothing.
     */
    async doCollapse() {
        const expanded = await this.getExpanded();
        if (expanded) {
            let icon = await this.findElement(selenium_webdriver_1.By.css('a.oj-collapsible-header-icon'));
            await icon.click();
        }
    }
    /**
     * Sets the value of <code>expanded</code> property.
     * Specifies if the content is expanded.
     * @param expanded The value to set for <code>expanded</code>
     * @deprecated Since 13.0.0. Use doCollapse/doExpand instead
     *
     */
    changeExpanded(expanded) {
        return this.setProperty('expanded', expanded);
    }
}
exports.OjCollapsible = OjCollapsible;
//# sourceMappingURL=OjCollapsible.js.map