StorefrontAdminEditDataTest.xml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  9. xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
  10. <test name="StorefrontAdminEditDataTest">
  11. <annotations>
  12. <features value="Bundle"/>
  13. <stories value="Bundle products list on Storefront"/>
  14. <title value="Customer should be able to see chosen options for Bundle Product in Shopping Cart when Option Title is edited in Admin"/>
  15. <description value="Customer should be able to see chosen options for Bundle Product in Shopping Cart when Option Title is edited in Admin"/>
  16. <severity value="MAJOR"/>
  17. <testCaseId value="MC-291"/>
  18. <group value="Bundle"/>
  19. </annotations>
  20. <before>
  21. <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
  22. <createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
  23. <createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
  24. </before>
  25. <after>
  26. <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
  27. <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
  28. <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
  29. </after>
  30. <!-- Create a bundle product -->
  31. <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
  32. <waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
  33. <actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct">
  34. <argument name="product" value="BundleProduct"/>
  35. </actionGroup>
  36. <actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku">
  37. <argument name="product" value="BundleProduct"/>
  38. </actionGroup>
  39. <!-- Add two bundle items -->
  40. <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
  41. <scrollTo stepKey="scrollToBundleItems" selector="{{AdminProductFormBundleSection.bundledItems}}"/>
  42. <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/>
  43. <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
  44. <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
  45. <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
  46. <waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
  47. <click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
  48. <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
  49. <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions">
  50. <argument name="product" value="$$simpleProduct1$$"/>
  51. </actionGroup>
  52. <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>
  53. <actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2">
  54. <argument name="product" value="$$simpleProduct2$$"/>
  55. </actionGroup>
  56. <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
  57. <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
  58. <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
  59. <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>
  60. <click stepKey="saveProductBundle" selector="{{AdminProductFormActionSection.saveButton}}"/>
  61. <see stepKey="assertSuccess" selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."/>
  62. <!-- Go to the storefront bundled product page -->
  63. <amOnPage url="/{{BundleProduct.urlKey}}.html" stepKey="visitStoreFrontBundle"/>
  64. <waitForPageLoad stepKey="waitForStorefront"/>
  65. <click stepKey="customizeAndAddToCart" selector="{{StorefrontBundledSection.addToCart}}"/>
  66. <waitForPageLoad stepKey="waitCustomizableOptionsPopUp"/>
  67. <!-- add one product to the shopping cart -->
  68. <click stepKey="selectFirstBundleOption" selector="{{StorefrontBundledSection.nthBundledOption('1','1')}}"/>
  69. <waitForPageLoad stepKey="waitForPriceUpdate"/>
  70. <see stepKey="seeSinglePrice" selector="{{StorefrontBundledSection.configuredPrice}}" userInput="1,230.00"/>
  71. <click stepKey="addFirstItemToCart" selector="{{StorefrontBundledSection.addToCartConfigured}}"/>
  72. <waitForPageLoad stepKey="waitForElementAdded"/>
  73. <!-- Go to the shopping cart page and grab the value of the option title -->
  74. <amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart"/>
  75. <waitForPageLoad stepKey="waitForCartPageLoad"/>
  76. <grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalBefore"/>
  77. <!-- Find the product that we just created using the product grid -->
  78. <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
  79. <waitForPageLoad stepKey="waitForAdminProductPageLoad"/>
  80. <conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
  81. <actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct">
  82. <argument name="product" value="BundleProduct"/>
  83. </actionGroup>
  84. <waitForPageLoad stepKey="waitForProductFilterLoad"/>
  85. <click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage"/>
  86. <waitForPageLoad stepKey="waitForProductPageLoad"/>
  87. <!-- Change the product option title -->
  88. <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="BundleOption2" stepKey="fillOptionTitle2"/>
  89. <click stepKey="saveProductAttribute2" selector="{{AdminProductFormActionSection.saveButton}}"/>
  90. <see stepKey="assertSuccess2" selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."/>
  91. <!-- Go to the shopping cart page and make sure the title has changed -->
  92. <amOnPage url="/checkout/cart/" stepKey="onPageShoppingCart1"/>
  93. <waitForPageLoad stepKey="waitForCartPageLoad1"/>
  94. <grabTextFrom selector="{{CheckoutCartProductSection.nthBundleOptionName('1')}}" stepKey="grabTotalAfter"/>
  95. <assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/>
  96. <!-- Delete the bundled product -->
  97. <actionGroup stepKey="deleteBundle" ref="deleteProductUsingProductGrid">
  98. <argument name="product" value="BundleProduct"/>
  99. </actionGroup>
  100. </test>
  101. </tests>