<?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="openPageBuilderEditPanel">
        <arguments>
            <argument name="contentType"/>
            <argument name="offsetXCoordinate" defaultValue="10" type="string"/>
            <argument name="offsetYCoordinate" defaultValue="0" type="string"/>
        </arguments>
        <moveMouseOver selector="{{PageBuilderPanel.searchPanel}}" stepKey="moveMouseToSearchPanel"/>
        <waitForElementVisible time="10" selector="{{PageBuilderStage.contentTypeInStage(contentType.role)}}" stepKey="waitForContentTypeInStageVisible"/>
        <executeJS function="return ['row', 'column', 'column-group'].include('{{contentType.role}}') ? '//div[contains(@class, &quot;pagebuilder-display-label&quot;) and contains(.,&quot;'+'{{contentType.name}}'.toUpperCase()+'&quot;)]' : ['tabs'].include('{{contentType.role}}') ? '//ul[@data-element=&quot;navigation&quot;]' : '';" stepKey="contentTypeLabelSelector" />
        <executeJS function="return ['row'].include('{{contentType.role}}') ? '//div[contains(@class, &quot;pagebuilder-content-type-affordance&quot;) and contains(concat(&quot; &quot;, @class, &quot; &quot;), &quot; pagebuilder-affordance-{{contentType.role}} &quot;)]' : '//div[contains(@class, &quot;pagebuilder-content-type&quot;) and contains(concat(&quot; &quot;, @class, &quot; &quot;), &quot; pagebuilder-{{contentType.role}} &quot;)]';" stepKey="contentTypeSelector" />
        <moveMouseOver selector="{$contentTypeSelector}{$contentTypeLabelSelector}" x="{{offsetXCoordinate}}" y="{{offsetYCoordinate}}" stepKey="onMouseOverContentTypeStage"/>
        <waitForPageLoad stepKey="waitForPageLoad"/>
        <waitForElementVisible time="10" selector="{{PageBuilderContentTypeOptionsMenu.contentTypeOptionsMenu(contentType.role)}}" stepKey="waitForOptions"/>
        <click selector="{{PageBuilderContentTypeOptionsMenu.contentTypeEdit(contentType.role)}}" stepKey="clickEditContentType"/>
        <waitForPageLoad time="30" stepKey="waitForEditFormToLoad"/>
        <waitForElementVisible selector="{{EditPanelForm.editForm}}" stepKey="waitForEditForm"/>
        <see userInput="Edit {{contentType.name}}" selector="{{EditPanelForm.editFormTitle}}" stepKey="seeContentTypeNameInEditFormTitle"/>
        <waitForLoadingMaskToDisappear stepKey="waitForAnimation2"/>
    </actionGroup>
</actionGroups>
