<?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="AdminElasticConnectionTestActionGroup">
        <annotations>
            <description>Check ElasticSearch connection after enabling.</description>
        </annotations>
        <amOnPage url="{{AdminCatalogSearchConfigurationPage.url}}" stepKey="openAdminCatalogSearchConfigPage"/>
        <waitForPageLoad stepKey="waitPageToLoad"/>
        <conditionalClick selector="{{AdminCatalogSearchConfigurationSection.catalogSearchTab}}" dependentSelector="{{AdminCatalogSearchConfigurationSection.elastic6ConnectionWizard}}" visible="false" stepKey="expandCatalogSearchTab"/>
        <waitForElementVisible selector="{{AdminCatalogSearchConfigurationSection.elastic6ConnectionWizard}}" stepKey="waitForConnectionButton"/>
        <click selector="{{AdminCatalogSearchConfigurationSection.elastic6ConnectionWizard}}" stepKey="clickOnTestConnectionButton"/>
        <waitForPageLoad stepKey="waitForConnectionEstablishment"/>
        <grabTextFrom selector="{{AdminCatalogSearchConfigurationSection.connectionStatus}}" stepKey="grabConnectionStatus"/>
        <assertEquals stepKey="assertThatConnectionSuccessful">
			<actualResult type="const">$grabConnectionStatus</actualResult>
			<expectedResult type="string">{{AdminElasticsearch6TestConnectionMessageData.successMessage}}</expectedResult>
        </assertEquals>
    </actionGroup>
</actionGroups>
