AdminCreateStoreViewActionGroup.xml 4.1 KB

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