AdminCreateStoreViewActionGroup.xml 4.12 KB
Newer Older
Ketan's avatar
Ketan committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
<?xml version="1.0" encoding="UTF-8"?>
<!--
 /**
  * Copyright © Magento, Inc. All rights reserved.
  * See COPYING.txt for license details.
  */
-->
<!-- Test XML Example -->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
    <actionGroup name="AdminCreateStoreViewActionGroup">
        <arguments>
            <argument name="StoreGroup" defaultValue="_defaultStoreGroup"/>
            <argument name="customStore" defaultValue="customStore"/>
        </arguments>
        <amOnPage url="{{AdminSystemStoreViewPage.url}}" stepKey="navigateToNewStoreView"/>
        <waitForPageLoad stepKey="waitForPageLoad1" />
        <comment userInput="Creating Store View" stepKey="storeViewCreationComment" />
        <!--Create Store View-->
        <selectOption selector="{{AdminNewStoreSection.storeGrpDropdown}}" userInput="{{StoreGroup.name}}" stepKey="selectStore" />
        <fillField selector="{{AdminNewStoreSection.storeNameTextField}}" userInput="{{customStore.name}}" stepKey="enterStoreViewName" />
        <fillField selector="{{AdminNewStoreSection.storeCodeTextField}}" userInput="{{customStore.code}}" stepKey="enterStoreViewCode" />
        <selectOption selector="{{AdminNewStoreSection.statusDropdown}}" userInput="Enabled" stepKey="setStatus" />
        <click selector="{{AdminNewStoreViewActionsSection.saveButton}}" stepKey="clickSaveStoreView" />
        <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForModal" />
        <see selector="{{AdminConfirmationModalSection.title}}" userInput="Warning message" stepKey="seeWarningAboutTakingALongTimeToComplete" />
        <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmModal" />
        <waitForPageLoad stepKey="waitForStorePageLoad" />
        <waitForElementNotVisible selector="{{AdminNewStoreViewActionsSection.loadingMask}}" stepKey="waitForElementVisible"/>
    </actionGroup>
    <!--Save the Store view-->
    <actionGroup name="AdminCreateStoreViewActionSaveGroup">
        <waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/>
        <waitForElementVisible selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="waitForStoreGridToReload2"/>
        <see userInput="You saved the store view." stepKey="seeSavedMessage" />
    </actionGroup>
    <!--Save the same Store view code for code validation-->
    <actionGroup name="AdminCreateStoreViewCodeUniquenessActionGroup">
        <waitForLoadingMaskToDisappear stepKey="waitForForm"/>
        <see userInput="Store with the same code already exists." stepKey="seeMessage" />
    </actionGroup>
    <actionGroup name="navigateToAdminContentManagementPage">
        <amOnPage url="{{AdminContentManagementPage.url}}" stepKey="navigateToConfigurationPage"/>
        <waitForPageLoad stepKey="waitForPageLoad1"/>
    </actionGroup>
    <actionGroup name="saveStoreConfiguration">
        <comment userInput="saveStoreConfiguration" stepKey="comment"/>
        <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/>
        <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/>
        <waitForPageLoad stepKey="waitForPageLoad"/>
    </actionGroup>
    <actionGroup name="saveStoreConfigurationAndValidateFieldError">
        <arguments>
            <argument name="inputFieldError" type="string"/>
            <argument name="errorMessageSelector" type="string"/>
            <argument name="errorMessage" type="string"/>
        </arguments>
        <comment userInput="saveStoreConfigurationAndValidateFieldError" stepKey="comment"/>
        <waitForElementVisible selector="{{StoreConfigSection.Save}}" stepKey="waitForSaveButton"/>
        <click selector="{{StoreConfigSection.Save}}" stepKey="clickSaveButton"/>
        <waitForElement selector="{{inputFieldError}}" stepKey="waitForErrorField"/>
        <waitForElementVisible selector="{{errorMessageSelector}}" stepKey="waitForErrorMessage"/>
        <see selector="{{errorMessageSelector}}" userInput="{{errorMessage}}" stepKey="seeErrorMessage"/>
    </actionGroup>
</actionGroups>