StorefrontMiniCartActionGroup.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  9. xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
  10. <actionGroup name="clickViewAndEditCartFromMiniCart">
  11. <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/>
  12. <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/>
  13. <click selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="viewAndEditCart"/>
  14. <seeInCurrentUrl url="checkout/cart" stepKey="seeInCurrentUrl"/>
  15. </actionGroup>
  16. <actionGroup name="assertOneProductNameInMiniCart">
  17. <arguments>
  18. <argument name="productName"/>
  19. </arguments>
  20. <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/>
  21. <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForViewAndEditCartVisible"/>
  22. <see selector="{{StorefrontMinicartSection.miniCartItemsText}}" userInput="{{productName}}" stepKey="seeInMiniCart"/>
  23. </actionGroup>
  24. <!--Remove an item from the cart using minicart-->
  25. <actionGroup name="removeProductFromMiniCart">
  26. <arguments>
  27. <argument name="productName" type="string"/>
  28. </arguments>
  29. <conditionalClick selector="{{StorefrontMinicartSection.showCart}}" dependentSelector="{{StorefrontMinicartSection.miniCartOpened}}" visible="false" stepKey="openMiniCart"/>
  30. <waitForElementVisible selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForMiniCartOpen"/>
  31. <click selector="{{StorefrontMinicartSection.deleteMiniCartItemByName(productName)}}" stepKey="clickDelete"/>
  32. <waitForElementVisible selector="{{StoreFrontRemoveItemModalSection.message}}" stepKey="waitForConfirmationModal"/>
  33. <see selector="{{StoreFrontRemoveItemModalSection.message}}" userInput="Are you sure you would like to remove this item from the shopping cart?" stepKey="seeDeleteConfirmationMessage"/>
  34. <click selector="{{StoreFrontRemoveItemModalSection.ok}}" stepKey="confirmDelete"/>
  35. <waitForPageLoad stepKey="waitForDeleteToFinish"/>
  36. </actionGroup>
  37. <!--Check that the minicart is empty-->
  38. <actionGroup name="assertMiniCartEmpty">
  39. <dontSeeElement selector="{{StorefrontMinicartSection.productCount}}" stepKey="dontSeeMinicartProductCount"/>
  40. <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="expandMinicart"/>
  41. <see selector="{{StorefrontMinicartSection.minicartContent}}" userInput="You have no items in your shopping cart." stepKey="seeEmptyCartMessage"/>
  42. </actionGroup>
  43. </actionGroups>