<?xml version="1.0" encoding="UTF-8"?>
<!--
 /**
  * Copyright © Magento, Inc. All rights reserved.
  * See COPYING.txt for license details.
  */
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
    <actionGroup name="addTextToTinyMCE">
        <arguments>
            <argument name="property" defaultValue=""/>
            <argument name="section" defaultValue="TextOnConfiguration"/>
        </arguments>
        <comment userInput="Adding Text To Tiny MCE" stepKey="commentAddTextToTinyMCE"/>
        <waitForElementVisible selector="#{{section.tinyMCEIFrame}}" stepKey="waitForIFrame"/>
        <executeJS function="tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + '{{property.value}}')" stepKey="addTextToWYSIWYG"/>
        <!-- Must click Tiny MCE or form will not recognize that text has been added -->
        <click selector="#{{section.tinyMCEIFrame}}" stepKey="clickIFrame"/>
        <switchToIFrame selector="{{section.tinyMCEIFrame}}" stepKey="switchToIFrame"/>
        <waitForElementVisible selector="{{section.textInIFrame(property.value)}}" stepKey="waitForTextVisible"/>
        <switchToIFrame stepKey="exitIFrame"/>
    </actionGroup>
</actionGroups>
