import { baseUniDriverFactory, getElement, } from '../utils/test-utils/unidriver';
import { buttonDriverFactory } from '../Button/Button.uni.driver';
export const messageBoxFunctionalLayoutUniDriverFactory = (base) => {
    const confirmationButton = base.$('[data-hook="confirmation-button"]');
    const cancellationButton = base.$('[data-hook="cancellation-button"]');
    const headerCloseButton = base.$('[data-hook="header-close-button"]');
    const confirmButtonDriver = buttonDriverFactory(confirmationButton);
    const cancelButtonDriver = buttonDriverFactory(cancellationButton);
    return {
        ...baseUniDriverFactory(base),
        exists: () => base.exists(),
        getConfirmationButtonText: () => confirmButtonDriver.getButtonTextContent(),
        isConfirmationButtonPrefixIconExists: async () => (await confirmationButton.prop('innerHTML')).indexOf('prefix') !== -1,
        isConfirmationButtonSuffixIconExists: async () => (await confirmationButton.prop('innerHTML')).indexOf('suffix') !== -1,
        clickOnConfirmationButton: () => confirmButtonDriver.click(),
        getConfirmationButton: () => getElement(confirmationButton),
        getCancellationButton: () => getElement(cancellationButton),
        getHeaderCloseButton: () => getElement(headerCloseButton),
        getCancellationButtonText: () => cancelButtonDriver.getButtonTextContent(),
        isCancellationButtonPrefixIconExists: async () => (await cancellationButton.prop('innerHTML')).indexOf('prefix') !== -1,
        isCancellationButtonSuffixIconExists: async () => (await cancellationButton.prop('innerHTML')).indexOf('suffix') !== -1,
        clickOnCancellationButton: () => cancelButtonDriver.click(),
        clickOnHeaderCloseButton: () => headerCloseButton.click(),
        isThemeExist: async (theme) => (await base.attr('data-theme')) === theme,
        getFooter: () => getElement(base.$('[data-hook="message-box-footer"]')),
        getTitle: () => base.$('[data-hook="header-layout-title"]').text(),
        getChildBySelector: (selector) => getElement(base.$(selector)),
        isCancelEnable: () => !cancelButtonDriver.isButtonDisabled(),
        isConfirmationEnable: () => !confirmButtonDriver.isButtonDisabled(),
        toHaveBodyPadding: async () => (await base.attr('data-nobodypadding')) !== 'true',
    };
};
//# sourceMappingURL=MessageBoxFunctionalLayout.uni.driver.js.map