<?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="DeleteExportedFileActionGroup">
        <annotations>
            <description>Deletes the exported file on the Exports grid page.</description>
        </annotations>
        <arguments>
            <argument name="fileName" type="string"/>
        </arguments>

        <amOnPage url="{{AdminExportIndexPage.url}}" stepKey="goToExportIndexPage"/>
        <waitForPageLoad time="30" stepKey="waitFormReload"/>
        <click stepKey="clickSelectBtn" selector="{{AdminExportAttributeSection.selectByFileName(fileName)}}"/>
        <click stepKey="clickOnDelete" selector="{{AdminExportAttributeSection.deleteByFileName(fileName)}}" after="clickSelectBtn"/>
        <waitForElementVisible selector="{{AdminProductGridConfirmActionSection.title}}" stepKey="waitForConfirmModal"/>
        <click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmDelete"/>
        <waitForPageLoad time="30" stepKey="waitFormReload2"/>
        <dontSeeElement selector="{{AdminExportAttributeSection.fileName(fileName)}}" stepKey="assertDontSeeFile"/>
    </actionGroup>
</actionGroups>
