diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminLoginWithCustomUrlActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminLoginWithCustomUrlActionGroup.xml index 65393741ae86a..72cd56e66de62 100644 --- a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminLoginWithCustomUrlActionGroup.xml +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminLoginWithCustomUrlActionGroup.xml @@ -1,11 +1,10 @@ - diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddImageCategoryAtAllStoreViewActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddImageCategoryAtAllStoreViewActionGroup.xml new file mode 100644 index 0000000000000..632860594ea7e --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAddImageCategoryAtAllStoreViewActionGroup.xml @@ -0,0 +1,23 @@ + + + + + + Requires navigation to the Category creation/edit page. Adds the provided image to a Category. + + + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertCategoryImageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertCategoryImageActionGroup.xml new file mode 100644 index 0000000000000..681790a619f56 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertCategoryImageActionGroup.xml @@ -0,0 +1,25 @@ + + + + + + Assert category image on admin. + + + + + + + + + + /{{image.filename}}(_[0-9]+)*?\.(jpg|png)$/ + grabCategoryFileName + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertCategoryNoImageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertCategoryNoImageActionGroup.xml new file mode 100644 index 0000000000000..41378ca27bfbd --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminAssertCategoryNoImageActionGroup.xml @@ -0,0 +1,17 @@ + + + + + + Assert category no image on admin. + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminChangeCategoryImageOnStoreviewActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminChangeCategoryImageOnStoreviewActionGroup.xml new file mode 100644 index 0000000000000..956bd75068209 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminChangeCategoryImageOnStoreviewActionGroup.xml @@ -0,0 +1,24 @@ + + + + + + Requires navigation to the Category creation/edit page. Adds the provided image to a Category. Validates that the Image exists. + + + + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectValueForVisibleOnStorefrontActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectValueForVisibleOnStorefrontActionGroup.xml new file mode 100644 index 0000000000000..4efa384874cc5 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSelectValueForVisibleOnStorefrontActionGroup.xml @@ -0,0 +1,23 @@ + + + + + + + Admin Select Yes for visible on Storefront on product attribute page. + + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetCatalogPriceToWebsiteActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetCatalogPriceToWebsiteActionGroup.xml new file mode 100644 index 0000000000000..676b9d104542f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetCatalogPriceToWebsiteActionGroup.xml @@ -0,0 +1,17 @@ + + + + + + + Admin set catalog price scope to website. + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetDefaultCatalogPriceActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetDefaultCatalogPriceActionGroup.xml new file mode 100644 index 0000000000000..9cbfda365e957 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminSetDefaultCatalogPriceActionGroup.xml @@ -0,0 +1,17 @@ + + + + + + + Admin set catalog price scope to default. + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminUpdateAttributeValuesOnProductDetailsPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminUpdateAttributeValuesOnProductDetailsPageActionGroup.xml new file mode 100644 index 0000000000000..1f97dca0ea1dc --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminUpdateAttributeValuesOnProductDetailsPageActionGroup.xml @@ -0,0 +1,30 @@ + + + + + + + Admin Update attribute values on product details page. + + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertCustomOptionValuesInProductDetailsPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertCustomOptionValuesInProductDetailsPageActionGroup.xml new file mode 100644 index 0000000000000..866260ea68fcd --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertCustomOptionValuesInProductDetailsPageActionGroup.xml @@ -0,0 +1,27 @@ + + + + + + + Storefront Assert Custom Option Values In Product Details Page. + + + + + + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductAndAttributeValuesOnProductPageActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductAndAttributeValuesOnProductPageActionGroup.xml new file mode 100644 index 0000000000000..4aba6a0347486 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontAssertProductAndAttributeValuesOnProductPageActionGroup.xml @@ -0,0 +1,28 @@ + + + + + + + Storefront assert attribute values on product details page. + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml index 948c126821ad7..56c1e6dafa6ea 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml @@ -1574,4 +1574,10 @@ EavStock1 CustomAttributeCategoryIds + + + magento.jpg + ProductOptionDropDownFor2 + ProductOptionCheckboxFor2 + diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryContentSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryContentSection.xml index ce07f34e503bf..6c38b457b78d0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryContentSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryContentSection.xml @@ -1,11 +1,10 @@ -
@@ -26,5 +25,6 @@ +
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml index 1336f2dd71b6a..3aca32d50e1ff 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryMainSection.xml @@ -1,8 +1,8 @@ @@ -50,5 +50,6 @@ + diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontDifferentImagesForCategoryForDifferentStoreViewTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontDifferentImagesForCategoryForDifferentStoreViewTest.xml new file mode 100644 index 0000000000000..0bc3dae4d2091 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontDifferentImagesForCategoryForDifferentStoreViewTest.xml @@ -0,0 +1,293 @@ + + + + + + + + + <description value="Different images can be set for category on different store view level"/> + <severity value="MAJOR"/> + <testCaseId value="AC-4134"/> + <group value="catalog"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!-- Create category --> + <createData entity="SimpleSubCategory" stepKey="createCategory"/> + <!-- Create 3 store views --> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView1"> + <argument name="customStore" value="customStoreNLNotUnique"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView2"> + <argument name="customStore" value="customStoreFR"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView3"> + <argument name="customStore" value="customStoreEN"/> + </actionGroup> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnHomePage"/> + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage11"> + <argument name="category" value="$$createCategory$$"/> + </actionGroup> + <waitForPageLoad stepKey="waitForStoreFrontPageLoad1"/> + <!-- open product in nl --> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewNL22"> + <argument name="storeView" value="customStoreNLNotUnique"/> + </actionGroup> + <!--open product in FR --> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewFR11"> + <argument name="storeView" value="customStoreFR"/> + </actionGroup> + <!-- open product in EN --> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewEN11"> + <argument name="storeView" value="customStoreEN"/> + </actionGroup> + </before> + <after> + <!-- delete 3 store views --> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView1"> + <argument name="customStore" value="customStoreNLNotUnique"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView2"> + <argument name="customStore" value="customStoreFR"/> + </actionGroup> + <actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreView3"> + <argument name="customStore" value="customStoreEN"/> + </actionGroup> + <deleteData createDataKey="createCategory" stepKey="deleteSimpleCategory"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <!-- add image 1st time --> + <!--Go to created category admin page and upload image--> + <actionGroup ref="GoToAdminCategoryPageByIdActionGroup" stepKey="goToAdminCategoryPage1"> + <argument name="id" value="$createCategory.id$"/> + </actionGroup> + <actionGroup ref="AdminAddImageCategoryAtAllStoreViewActionGroup" stepKey="addCategoryImage"> + <argument name="image" value="ProductImage"/> + </actionGroup> + <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="clickSaveButton1"/> + <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertCategorySaveSuccessMessage1"/> + <!-- Switch to the New Website Store view NL--> + <waitForPageLoad stepKey="waitForEditCatalogPage1"/> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewNL1"> + <argument name="storeView" value="customStoreNLNotUnique.name"/> + </actionGroup> + <actionGroup ref="AdminChangeCategoryImageOnStoreviewActionGroup" stepKey="addPlaceholderSmallImage"> + <argument name="image" value="ImageUpload_1"/> + </actionGroup> + <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="clickSaveButton2"/> + <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertCategorySaveSuccessMessage2"/> + <!-- Switch to the New Website Store view FR--> + <waitForPageLoad stepKey="waitForEditCatalogPage2"/> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewFR1"> + <argument name="storeView" value="customStoreFR.name"/> + </actionGroup> + <actionGroup ref="AdminChangeCategoryImageOnStoreviewActionGroup" stepKey="addPlaceholderSmallImage1"> + <argument name="image" value="ImageUpload3"/> + </actionGroup> + <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="clickSaveButton3"/> + <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertCategorySaveSuccessMessage3"/> + <!--assert images in admin 1st time --> + <actionGroup ref="GoToAdminCategoryPageByIdActionGroup" stepKey="goToAdminCategoryPage2"> + <argument name="id" value="$createCategory.id$"/> + </actionGroup> + <actionGroup ref="AdminAssertCategoryImageActionGroup" stepKey="assertImageAdminDF1"> + <argument name="image" value="ProductImage"/> + </actionGroup> + <!-- assert in be NL storeview--> + <waitForPageLoad stepKey="waitForEditCatalogPage4"/> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewNL2"> + <argument name="storeView" value="customStoreNLNotUnique.name"/> + </actionGroup> + <actionGroup ref="AdminAssertCategoryImageActionGroup" stepKey="assertImageAdminNL1"> + <argument name="image" value="ImageUpload_1"/> + </actionGroup> + <!--assert in be FR storeview--> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewFR2"> + <argument name="storeView" value="customStoreFR.name"/> + </actionGroup> + <actionGroup ref="AdminAssertCategoryImageActionGroup" stepKey="assertImageAdminFR1"> + <argument name="image" value="ImageUpload3"/> + </actionGroup> + <!--assert in be EN storeview--> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewEN2"> + <argument name="storeView" value="customStoreEN.name"/> + </actionGroup> + <actionGroup ref="AdminAssertCategoryImageActionGroup" stepKey="assertImageAdminEN1"> + <argument name="image" value="ProductImage"/> + </actionGroup> + <!-- Assert images on FE 1st time--> + <!-- Open created category on Storefront --> + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage2"> + <argument name="category" value="$createCategory$"/> + </actionGroup> + <!--assert in NL--> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToNLStoreView1"> + <argument name="storeView" value="customStoreNLNotUnique"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.imageSource(ImageUpload_1.fileName)}}" stepKey="seeImage2"/> + <!--assert in FR--> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToFRStoreView1"> + <argument name="storeView" value="customStoreFR"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.imageSource(ImageUpload3.fileName)}}" stepKey="seeImage3"/> + <!-- assert in EN --> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToENStoreView1"> + <argument name="storeView" value="customStoreEN"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.imageSource(ProductImage.fileName)}}" stepKey="seeImage4"/> + <!--assert in default--> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToDFStoreView1"> + <argument name="storeView" value="_defaultStore"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.imageSource(ProductImage.fileName)}}" stepKey="seeImage1"/> + <!--edit images again for store views 2nd time--> + <actionGroup ref="GoToAdminCategoryPageByIdActionGroup" stepKey="goToAdminCategoryPage3"> + <argument name="id" value="$createCategory.id$"/> + </actionGroup> + <actionGroup ref="AdminAddImageCategoryAtAllStoreViewActionGroup" stepKey="addCategoryImage1"> + <argument name="image" value="AdobeThumbImage"/> + </actionGroup> + <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="clickSaveButton4"/> + <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertCategorySaveSuccessMessage4"/> + <!-- Switch to the New Website Store view NL--> + <waitForPageLoad stepKey="waitForEditCatalogPage9"/> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewNL3"> + <argument name="storeView" value="customStoreNLNotUnique.name"/> + </actionGroup> + <!-- Remove image from category --> + <actionGroup ref="RemoveCategoryImageActionGroup" stepKey="removeCategoryImage"/> + <actionGroup ref="AdminSaveCategoryFormActionGroup" stepKey="saveCategoryFormAfterRemove"/> + <!-- Switch to the New Website Store view EN--> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewEN3"> + <argument name="storeView" value="customStoreEN.name"/> + </actionGroup> + <actionGroup ref="AdminChangeCategoryImageOnStoreviewActionGroup" stepKey="addPlaceholderSmallImage2"> + <argument name="image" value="MagentoImage"/> + </actionGroup> + <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="clickSaveButton5"/> + <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertCategorySaveSuccessMessage5"/> + <!--assert images in admin 2nd time--> + <actionGroup ref="GoToAdminCategoryPageByIdActionGroup" stepKey="goToAdminCategoryPage4"> + <argument name="id" value="$createCategory.id$"/> + </actionGroup> + <!-- assert in all store view --> + <actionGroup ref="AdminAssertCategoryImageActionGroup" stepKey="assertImageAdminDF4"> + <argument name="image" value="AdobeThumbImage"/> + </actionGroup> + <!-- assert in be NL storeview--> + <waitForPageLoad stepKey="waitForEditCatalogPage12"/> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewNL4"> + <argument name="storeView" value="customStoreNLNotUnique.name"/> + </actionGroup> + <actionGroup ref="AdminAssertCategoryNoImageActionGroup" stepKey="assertImageAdminNL4"/> + <!-- assert in be FR storeview--> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewFR4"> + <argument name="storeView" value="customStoreFR.name"/> + </actionGroup> + <actionGroup ref="AdminAssertCategoryImageActionGroup" stepKey="assertImageAdminFR4"> + <argument name="image" value="ImageUpload3"/> + </actionGroup> + <!-- assert in be EN storeview--> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewEN4"> + <argument name="storeView" value="customStoreEN.name"/> + </actionGroup> + <actionGroup ref="AdminAssertCategoryImageActionGroup" stepKey="assertImageAdminEN4"> + <argument name="image" value="MagentoImage"/> + </actionGroup> + <!--assert in FE 2nd time --> + <!-- Open created category on Storefront --> + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage3"> + <argument name="category" value="$createCategory$"/> + </actionGroup> + <!--assert in NL--> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToNLStoreView2"> + <argument name="storeView" value="customStoreNLNotUnique"/> + </actionGroup> + <dontSee selector="{{StorefrontCategoryMainSection.categoryImage}}" stepKey="dontSeeImage1"/> + <!--assert in FR--> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToFRStoreView2"> + <argument name="storeView" value="customStoreFR"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.imageSource(ImageUpload3.fileName)}}" stepKey="seeImage6"/> + <!-- assert in EN --> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToENStoreView2"> + <argument name="storeView" value="customStoreEN"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.imageSource(MagentoImage.fileName)}}" stepKey="seeImage7"/> + <!--assert in default--> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToDFStoreView2"> + <argument name="storeView" value="_defaultStore"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.imageSource(AdobeThumbImage.fileName)}}" stepKey="seeImage5"/> + <!--edit images again for store views for 3rd time--> + <actionGroup ref="GoToAdminCategoryPageByIdActionGroup" stepKey="goToAdminCategoryPage5"> + <argument name="id" value="$createCategory.id$"/> + </actionGroup> + <!-- Remove image from category --> + <actionGroup ref="RemoveCategoryImageActionGroup" stepKey="removeCategoryImage1"/> + <actionGroup ref="AdminSaveCategoryFormActionGroup" stepKey="saveCategoryFormAfterRemove1"/> + <!-- assert images in admin 3rd time--> + <actionGroup ref="GoToAdminCategoryPageByIdActionGroup" stepKey="goToAdminCategoryPage6"> + <argument name="id" value="$createCategory.id$"/> + </actionGroup> + <!-- assert in _defaultStore --> + <waitForPageLoad stepKey="waitForEditCatalogPage15"/> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewDF5"> + <argument name="storeView" value="_defaultStore.name"/> + </actionGroup> + <actionGroup ref="AdminAssertCategoryNoImageActionGroup" stepKey="assertImageAdminDF5"/> + <!--assert in be NL storeview--> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewNL5"> + <argument name="storeView" value="customStoreNLNotUnique.name"/> + </actionGroup> + <actionGroup ref="AdminAssertCategoryNoImageActionGroup" stepKey="assertImageAdminNL5"/> + <!-- assert in be FR storeview--> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewFR5"> + <argument name="storeView" value="customStoreFR.name"/> + </actionGroup> + <actionGroup ref="AdminAssertCategoryImageActionGroup" stepKey="assertImageAdminFR5"> + <argument name="image" value="ImageUpload3"/> + </actionGroup> + <!--assert in be EN storeview--> + <waitForPageLoad stepKey="waitForEditCatalogPage18"/> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToNewStoreViewEN5"> + <argument name="storeView" value="customStoreEN.name"/> + </actionGroup> + <actionGroup ref="AdminAssertCategoryImageActionGroup" stepKey="assertImageAdminEN5"> + <argument name="image" value="MagentoImage"/> + </actionGroup> + <!--assert in FE 3rd time--> + <!-- Open created category on Storefront --> + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage4"> + <argument name="category" value="$createCategory$"/> + </actionGroup> + <!--assert in NL--> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToNLStoreView3"> + <argument name="storeView" value="customStoreNLNotUnique"/> + </actionGroup> + <dontSee selector="{{StorefrontCategoryMainSection.categoryImage}}" stepKey="dontSeeImage3"/> + <!--assert in FR--> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToFRStoreView3"> + <argument name="storeView" value="customStoreFR"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.imageSource(ImageUpload3.fileName)}}" stepKey="seeImage8"/> + <!-- assert in EN --> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToENStoreView3"> + <argument name="storeView" value="customStoreEN"/> + </actionGroup> + <waitForElementVisible selector="{{StorefrontCategoryMainSection.imageSource(MagentoImage.fileName)}}" stepKey="seeImage9"/> + <!--assert in default--> + <actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchToDFStoreView3"> + <argument name="storeView" value="_defaultStore"/> + </actionGroup> + <dontSee selector="{{StorefrontCategoryMainSection.categoryImage}}" stepKey="dontSeeImage2"/> + + </test> +</tests> + diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyGiftsCardsAndCouponCodesInWidgetIsShownOnOrderReviewPageForPayflowLinkTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyGiftsCardsAndCouponCodesInWidgetIsShownOnOrderReviewPageForPayflowLinkTest.xml new file mode 100644 index 0000000000000..0a21914c45f3e --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontApplyGiftsCardsAndCouponCodesInWidgetIsShownOnOrderReviewPageForPayflowLinkTest.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontApplyGiftsCardsAndCouponCodesInWidgetIsShownOnOrderReviewPageForPayflowLinkTest"> + <annotations> + <features value="Payments"/> + <stories value="Payflow Link"/> + <title value="Apply gift cards and promo codes widget are shown on Order review page for Payflow Link"/> + <description value="As a guest, apply coupon and gift card while placing an order through paypal payflow Link"/> + <severity value="MAJOR"/> + <testCaseId value="AC-4378"/> + </annotations> + <before> + <!--Create simple product--> + <createData entity="simpleProductWithoutCategory" stepKey="createProduct"> + <field key="price">100.00</field> + </createData> + <!--Create a customer--> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <!--Login to admin site--> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!--Create cart price rule and coupon--> + <actionGroup ref="AdminCreateCartPriceRuleWithCouponCodeActionGroup" stepKey="createCartPriceRule"> + <argument name="ruleName" value="CatPriceRule"/> + <argument name="couponCode" value="CatPriceRule.coupon_code"/> + </actionGroup> + </before> + <after> + <!--Delete created product--> + <deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/> + <!--Delete created cart price rule--> + <actionGroup ref="AdminCartPriceRuleDeleteAllActionGroup" stepKey="deleteAllCartPriceRules"/> + <!--Delete created customer--> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <!--Logout from admin site--> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <actionGroup ref="StorefrontAddSimpleProductWithQtyActionGroup" stepKey="addSimpleProductToCart"> + <argument name="product" value="$$createProduct$$"/> + <argument name="quantity" value="1"/> + </actionGroup> + <!--Go to shopping cart--> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.checkoutWithPaypal}}" stepKey="waitForPayPalBtn"/> + <click selector="{{CheckoutPaymentSection.checkoutWithPaypal}}" stepKey="clickPayPalBtn"/> + <waitForElementClickable selector="{{CheckoutPaymentSection.reviewOrder}}" stepKey="waitForReviewOrderButtonToBeClickable"/> + <click selector="{{CheckoutPaymentSection.reviewOrder}}" stepKey="clickReviewOrderButton"/> + <waitForPageLoad stepKey="waitForPageLoad"/> + </test> +</tests> diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/StorefrontAssertSeveralTermsAndConditionsOnPayPalPayFlowProCheckoutReviewPageTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/StorefrontAssertSeveralTermsAndConditionsOnPayPalPayFlowProCheckoutReviewPageTest.xml new file mode 100644 index 0000000000000..6d6f377be3858 --- /dev/null +++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/StorefrontAssertSeveralTermsAndConditionsOnPayPalPayFlowProCheckoutReviewPageTest.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontAssertSeveralTermsAndConditionsOnPayPalPayFlowProCheckoutReviewPageTest"> + <annotations> + <features value="CheckoutAgreements"/> + <stories value="Checkout agreements and Paypal payflow pro checkout"/> + <title value="Assert Several Terms And Conditions On PayPal Pay Flow Pro Checkout Review Page"/> + <description value="Several Terms and Conditions with different types are shown on PayPal payflow pro checkout review page"/> + <severity value="MAJOR"/> + <testCaseId value="AC-4428"/> + <group value="paypalPayflowProWithOutValut"/> + <group value="3rd_party_integration"/> +<!-- <group value="pr_exclude" />--> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + <createData entity="SimpleProduct" stepKey="createSimpleProduct"/> + <actionGroup ref="AdminEnableTermsAndConditionsConfigurationActionGroup" stepKey="EnableTermsAndConditions"/> + <createData entity="Simple_US_Customer_NY" stepKey="createCustomer"/> + <!-- create manual term --> + <actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTermForManualTerm"/> + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="createManualTerm"> + <argument name="term" value="newHtmlTerm"/> + </actionGroup> + <actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveManualTerm"/> + <!-- create automatic term --> + <actionGroup ref="AdminTermsConditionsOpenNewTermPageActionGroup" stepKey="openNewTermForAutomaticTerm"/> + <actionGroup ref="AdminTermsConditionsFillTermEditFormActionGroup" stepKey="createAutomaticTerm"> + <argument name="term" value="newHtmlAutomaticallyTerm"/> + </actionGroup> + <actionGroup ref="AdminTermsConditionsSaveTermActionGroup" stepKey="saveAutomaticTerm"/> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + </before> + <after> + <!--Delete created data--> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + <actionGroup ref="AdminTermsConditionsOpenGridActionGroup" stepKey="openTermsGridToDelete"/> + <actionGroup ref="AdminDeleteAllTermConditionsActionGroup" stepKey="deleteAllTerms"/> + <actionGroup ref="AdminDisableTermsAndConditionsConfigurationActionGroup" stepKey="disableTermsAndConditions"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> + </after> + <!-- Login as customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storeFrontCustomerLogin"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$createSimpleProduct$"/> + </actionGroup> + <!--Navigate to checkout--> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="openCheckoutPage"/> + <!-- Click next button to open payment section --> + <actionGroup ref="StorefrontCheckoutClickNextButtonActionGroup" stepKey="clickNext"/> + <!-- Click on PayPal payment radio button --> + <waitForElementClickable selector="{{CheckoutPaymentSection.PayPalExpressCheckoutPayFlowEdition}}" stepKey="waitForPayPalRadioButton"/> + <click selector="{{CheckoutPaymentSection.PayPalExpressCheckoutPayFlowEdition}}" stepKey="selectPayPalExpressCheckoutPayFlowEdition"/> + <!-- Verify both manual and automatic are present --> + <waitForText selector="{{StorefrontCheckoutAgreementsSection.manualCheckoutAgreementLink('agreement_payflow_express')}}" userInput="{{newHtmlTerm.checkboxText}}" stepKey="seeManualTermTextInCheckoutIsPresent"/> + <waitForText selector="{{StorefrontCheckoutAgreementsSection.automaticCheckoutAgreementLink('agreement_payflow_express')}}" userInput="{{newHtmlAutomaticallyTerm.checkboxText}}" stepKey="seeAutomaticTermTextInCheckoutIsPresent"/> + <!-- open manual terms and conditions and verify content messages--> + <waitForElementClickable selector="{{StorefrontCheckoutAgreementsSection.manualCheckoutAgreementLink('agreement_payflow_express')}}" stepKey="waitForManualTermTextInCheckoutIsClickable"/> + <click selector="{{StorefrontCheckoutAgreementsSection.manualCheckoutAgreementLink('agreement_payflow_express')}}" stepKey="clickManualTermTextInCheckout"/> + <waitForElement selector="{{StorefrontCheckoutAgreementsSection.contentArea(newHtmlTerm.content)}}" stepKey="verifyManualTermContentTextMessage"/> + <waitForElementClickable selector="{{StorefrontCheckoutAgreementsSection.agreementClose}}" stepKey="waitForCloseToBeClickable"/> + <click selector="{{StorefrontCheckoutAgreementsSection.agreementClose}}" stepKey="ClickOnClose"/> + <!-- open automatic terms and conditions and verify content messages--> + <waitForElementClickable selector="{{StorefrontCheckoutAgreementsSection.automaticCheckoutAgreementLink('agreement_payflow_express')}}" stepKey="waitForAutomaticTermTextInCheckoutIsClickable"/> + <click selector="{{StorefrontCheckoutAgreementsSection.automaticCheckoutAgreementLink('agreement_payflow_express')}}" stepKey="clickAutomaticTermTextInCheckoutIsClickable"/> + <waitForElement selector="{{StorefrontCheckoutAgreementsSection.contentArea(newHtmlAutomaticallyTerm.content)}}" stepKey="verifyAutomaticTermContentTextMessage"/> + </test> +</tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAsLowAsPriceNotDisplayedForDifferentWebsiteCatalogPriceScopeWebsiteTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAsLowAsPriceNotDisplayedForDifferentWebsiteCatalogPriceScopeWebsiteTest.xml new file mode 100644 index 0000000000000..293779c6392c4 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminAsLowAsPriceNotDisplayedForDifferentWebsiteCatalogPriceScopeWebsiteTest.xml @@ -0,0 +1,209 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAsLowAsPriceNotDisplayedForDifferentWebsiteCatalogPriceScopeWebsiteTest"> + <annotations> + <features value="ConfigurableProduct"/> + <stories value="As low as pricing behaviour for products across multiple websites"/> + <title value="Customer should not see 'As low as' label for products with different website prices"/> + <description value="Ensure that the 'As low as' label is not shown for Product with varied pricing across websites when catalog price scope is set to website"/> + <severity value="MAJOR"/> + <testCaseId value="AC-4270"/> + </annotations> + <before> + <createData entity="ApiCategory" stepKey="createFirstCategory"/> + <createData entity="NewRootCategory" stepKey="createRootCategory"/> + <createData entity="SimpleRootSubCategory" stepKey="createSecondCategory"> + <requiredEntity createDataKey="createRootCategory"/> + </createData> + <!--Set catalog price scope to Website--> + <actionGroup ref="AdminSetCatalogPriceToWebsiteActionGroup" stepKey="setPriceScopeWebsite"/> + <createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct"> + <field key="name">Configurable product p1</field> + <requiredEntity createDataKey="createFirstCategory"/> + </createData> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!--Create website--> + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> + <argument name="newWebsiteName" value="{{customWebsite.name}}"/> + <argument name="websiteCode" value="{{customWebsite.code}}"/> + </actionGroup> + <!--Create custom store group--> + <actionGroup ref="CreateCustomStoreActionGroup" stepKey="createCustomStoreGroup"> + <argument name="website" value="{{customWebsite.name}}"/> + <argument name="store" value="{{customStoreGroup.name}}"/> + <argument name="rootCategory" value="$$createRootCategory.name$$"/> + </actionGroup> + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createNewStoreView"> + <argument name="StoreGroup" value="customStoreGroup"/> + <argument name="customStore" value="customStore"/> + </actionGroup> + <!-- Create text swatch attribute with 3 options: Black, White and Blue --> + <actionGroup ref="AddTextSwatchToProductActionGroup" stepKey="addColorAttribute"> + <argument name="attributeName" value="{{ProductColorAttribute.frontend_label}}"/> + <argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/> + <argument name="option1" value="Red"/> + <argument name="option2" value="Green"/> + <argument name="option3" value="Blue"/> + </actionGroup> + <!-- Open configurable product edit page --> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProduct"> + <argument name="productId" value="$createConfigurableProduct.id$"/> + </actionGroup> + <!-- Generate configurations for configurable product p1 --> + <actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="createProductConfigurations"> + <argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/> + </actionGroup> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changePriceForRed"> + <argument name="productAttributes" value="Color: Red"/> + <argument name="productPrice" value="10"/> + </actionGroup> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changePriceForGreen"> + <argument name="productAttributes" value="Color: Green"/> + <argument name="productPrice" value="10"/> + </actionGroup> + <actionGroup ref="ChangeConfigurableProductChildProductPriceActionGroup" stepKey="changePriceForBlue"> + <argument name="productAttributes" value="Color: Blue"/> + <argument name="productPrice" value="10"/> + </actionGroup> + <actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveConfigurableProduct"/> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsiteSecondForConfigurable"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignProductToSecondCategory"> + <argument name="categoryName" value="$$createSecondCategory.name$$"/> + </actionGroup> + <!-- Open Red product edit page --> + <actionGroup ref="SearchForProductOnBackendByNameActionGroup" stepKey="searchForRedProduct"> + <argument name="productName" value="red"/> + </actionGroup> + <actionGroup ref="AdminProductGridSectionClickFirstRowActionGroup" stepKey="openRedProduct"/> + <waitForElement selector="{{AdminProductFormSection.visibility}}" stepKey="waitForVisibilityToBeVisibleForRed"/> + <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="Catalog, Search" stepKey="selectVisibilityForRed"/> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignRedProductToSecondCategory"> + <argument name="categoryName" value="$$createSecondCategory.name$$"/> + </actionGroup> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsiteSecondForRed"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + <!-- Open blue product edit page --> + <actionGroup ref="SearchForProductOnBackendByNameActionGroup" stepKey="searchForBlueProduct"> + <argument name="productName" value="blue"/> + </actionGroup> + <actionGroup ref="AdminProductGridSectionClickFirstRowActionGroup" stepKey="openBlueProduct"/> + <waitForElement selector="{{AdminProductFormSection.visibility}}" stepKey="waitForVisibilityToBeVisibleForBlue"/> + <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="Catalog, Search" stepKey="selectVisibilityForBlue"/> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignBlueProductToSecondCategory"> + <argument name="categoryName" value="$$createSecondCategory.name$$"/> + </actionGroup> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsiteSecondForBlue"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + <!-- Open Green product edit page --> + <actionGroup ref="SearchForProductOnBackendByNameActionGroup" stepKey="searchForGreenProduct"> + <argument name="productName" value="Green"/> + </actionGroup> + <actionGroup ref="AdminProductGridSectionClickFirstRowActionGroup" stepKey="openGreenProduct"/> + <waitForElement selector="{{AdminProductFormSection.visibility}}" stepKey="waitForVisibilityToBeVisibleForGreen"/> + <selectOption selector="{{AdminProductFormSection.visibility}}" userInput="Catalog, Search" stepKey="selectVisibilityForGreen"/> + <actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignGreenProductToSecondCategory"> + <argument name="categoryName" value="$$createSecondCategory.name$$"/> + </actionGroup> + <actionGroup ref="ProductSetWebsiteActionGroup" stepKey="ProductSetWebsiteSecondForGreen"> + <argument name="website" value="{{customWebsite.name}}"/> + </actionGroup> + <!-- Open Red product edit page --> + <actionGroup ref="SearchForProductOnBackendByNameActionGroup" stepKey="searchForRedProductAgain"> + <argument name="productName" value="red"/> + </actionGroup> + <actionGroup ref="AdminProductGridSectionClickFirstRowActionGroup" stepKey="againOpenRedProduct"/> + <!-- Switch to custom website store view --> + <actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchToCustomStoreView"> + <argument name="storeView" value="customStore.name"/> + </actionGroup> + <uncheckOption selector="{{AdminProductFormSection.productPriceUseDefault}}" stepKey="uncheckPriceDefaultValue"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="5" stepKey="fillSimpleProductPrice"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveRedProductInCustomStoreView"/> + <!-- Switch to the All store view --> + <actionGroup ref="AdminSwitchToAllStoreViewActionGroup" stepKey="switchAllStoreViewProduct"/> + <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="1" stepKey="fillSimpleProductPriceInAllStoreView"/> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductInAllStoreView"/> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value="catalog_category_product catalog_product_category"/> + </actionGroup> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushPageCache"> + <argument name="tags" value="full_page"/> + </actionGroup> + </before> + <after> + <!--set main website as default--> + <actionGroup ref="AdminSetDefaultWebsiteActionGroup" stepKey="setMainWebsiteAsDefault"> + <argument name="websiteName" value="Main Website"/> + </actionGroup> + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> + <argument name="websiteName" value="{{customWebsite.name}}"/> + </actionGroup> + <deleteData createDataKey="createFirstCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createSecondCategory" stepKey="deleteSubCategory"/> + <deleteData createDataKey="createRootCategory" stepKey="deleteRootCategory"/> + <actionGroup ref="AdminSetDefaultCatalogPriceActionGroup" stepKey="setDefaultCatalogConfigurations"/> + <actionGroup ref="DeleteAllProductsUsingProductGridActionGroup" stepKey="deleteCreatedProducts"/> + <!-- Delete color attribute --> + <actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteColorAttribute"> + <argument name="ProductAttribute" value="ProductColorAttribute"/> + </actionGroup> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexAfter"> + <argument name="indices" value="catalog_category_product catalog_product_category"/> + </actionGroup> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushPageCacheAfter"> + <argument name="tags" value="full_page"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> + </after> + <!-- Open created category on Storefront --> + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPageOnMainWebsite"> + <argument name="category" value="$createFirstCategory$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceAndPriceLabelIsNotPresentOnCategoryPageActionGroup" stepKey="assertPriceAndPriceLabelForProductOnMainWebsite"> + <argument name="productName" value="Configurable product p1-Red"/> + <argument name="price" value="1"/> + <argument name="priceLabel" value="As low as"/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategoryPageOnMainWebsite"> + <argument name="productName" value="Configurable product p1-Red"/> + </actionGroup> + <dontSeeElement selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeAsLowAsLabelProducPageOnMainWebsite"/> + <actionGroup ref="AssertStorefrontProductDetailPageFinalPriceActionGroup" stepKey="assertProductFinalPriceForRedOnMainWebsite"> + <argument name="finalProductPrice" value="1.00"/> + </actionGroup> + <actionGroup ref="AdminSetDefaultWebsiteActionGroup" stepKey="SetSecondaryWebsiteAsDefault"> + <argument name="websiteName" value="{{customWebsite.name}}"/> + </actionGroup> + <!-- Clean config and full page cache--> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <!-- Open created second category on second website --> + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPageOnSecondWebsite"> + <argument name="category" value="$createSecondCategory$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertProductPriceAndPriceLabelIsNotPresentOnCategoryPageActionGroup" stepKey="assertPriceAndPriceLabelForProductOnSecondWebsite"> + <argument name="productName" value="Configurable product p1-Red"/> + <argument name="price" value="5"/> + <argument name="priceLabel" value="As low as"/> + </actionGroup> + <actionGroup ref="StorefrontOpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategoryPageOnSecondWebsite"> + <argument name="productName" value="Configurable product p1-Red"/> + </actionGroup> + <dontSeeElement selector="{{StorefrontProductInfoMainSection.productPriceLabel}}" stepKey="dontSeeAsLowAsLabelForProductOnSecondWebsite"/> + <actionGroup ref="AssertStorefrontProductDetailPageFinalPriceActionGroup" stepKey="assertProductFinalPriceForRedOnSecondWebsite"> + <argument name="finalProductPrice" value="5.00"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminAssertPaypalAllInOnePaymentMethodActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminAssertPaypalAllInOnePaymentMethodActionGroup.xml new file mode 100644 index 0000000000000..da3d4d1874353 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminAssertPaypalAllInOnePaymentMethodActionGroup.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertPaypalAllInOnePaymentMethodActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Payment Methods'. Checks Payment Methods Exists on Paypal All In One Payments Solution </description> + </annotations> + <arguments> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> + <waitForPageLoad stepKey="waitForConfigPageLoad"/> + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="expandOtherPaypalConfigButton"/> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.paypalAllInOne(countryCode)}}" stepKey="assertPayinAllLink"/> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.paypalPaymentGatewayLink(countryCode)}}" stepKey="assertPaypalPaymentGateway"/> + <scrollTo selector="{{AdminConfigPaymentsAdvancedSection.paypalAllInOne(countryCode)}}" stepKey="scrollPayinAll"/> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.paymentsAdvanced(countryCode)}}" stepKey="assertPaymentAdvanced"/> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.paymentsPro(countryCode)}}" stepKey="assertPaymentsPro"/> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.paymentsStandard(countryCode)}}" stepKey="assertPaymentStandard"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminAssertPaypalCreditPaymentsProActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminAssertPaypalCreditPaymentsProActionGroup.xml new file mode 100644 index 0000000000000..a749aa927b5ed --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminAssertPaypalCreditPaymentsProActionGroup.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertPaypalCreditPaymentsProActionGroup" extends="AdminConfigurePayPalPaymentsProActionGroup"> + <annotations> + <description>Configuration for Payments pro with Sample PayPal credentials and Assert Other Paypal Solution</description> + </annotations> + <arguments> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + <remove keyForRemoval="expandOtherPaypalConfigButton"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection" before="waitForPayPalPaymentsProConfigureBtn"/> + <seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enableSolution(countryCode)}}" userInput="No" stepKey="seeEnableThisSolutionIsSetAsNo" after="enableTestMode"/> + <assertElementContainsAttribute stepKey="seeEnablePaypalCreditIsDisabled" after="seeEnableThisSolutionIsSetAsNo"> + <expectedResult selector="{{PayPalPaymentsProConfigSection.enablePaypalCredit(countryCode)}}" attribute="disabled" type="string"></expectedResult> + </assertElementContainsAttribute> + <assertElementContainsAttribute stepKey="seeEnableVaultIsDisabled" after="scrollToBottom"> + <expectedResult selector="{{PayPalPaymentsProConfigSection.enableVault(countryCode)}}" attribute="disabled" type="string"></expectedResult> + </assertElementContainsAttribute> + <!-- Check that Paypal Credit and Vault is set to No and it is disabled --> + <seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enablePaypalCredit(countryCode)}}" userInput="No" stepKey="seePaypalCreditIsSetAsNo" after="seeEnablePaypalCreditIsDisabled"/> + <seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enableVault(countryCode)}}" userInput="No" stepKey="seeValultIsSetAsNo" after="seeEnableVaultIsDisabled"/> + <waitForElementVisible selector="{{PayPalPaymentsProConfigSection.disabledEnableSolution(countryCode)}}" stepKey="assertGreenTickMarkForEnableThisSolutionDropdown" after="enableSolution"/> + <waitForElementVisible selector="{{PayPalPaymentsProConfigSection.disabledPaypalCredit(countryCode)}}" stepKey="assertGreenTickMarkForEnablePaypalCredit" after="assertGreenTickMarkForEnableThisSolutionDropdown"/> + <waitForElementVisible selector="{{PayPalPaymentsProConfigSection.sortOrder(countryCode)}}" stepKey="assertSortOrder" after="assertGreenTickMarkForEnablePaypalCredit"/> + <selectOption selector="{{PayPalPaymentsProConfigSection.enableVault(countryCode)}}" userInput="Yes" stepKey="setValultIsSetAsYes" before="waitForSaveButtonBecomeClickable"/> + <waitForElementVisible selector="{{PayPalPaymentsProConfigSection.disabledVault(countryCode)}}" stepKey="assertGreenTickMarkForEnableVaultDropdown" after="setValultIsSetAsYes"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminClearPaymentAdvancedDataActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminClearPaymentAdvancedDataActionGroup.xml new file mode 100644 index 0000000000000..64d2d37f767ae --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminClearPaymentAdvancedDataActionGroup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClearPaymentAdvancedDataActionGroup"> + <annotations> + <description>Admin goes to payments advanced configuration and clears provided Sample PayPal credentials</description> + </annotations> + <arguments> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + <waitForPageLoad stepKey="waitForPageLoad1"/> + <waitForElementClickable selector="{{AdminConfigPaymentsAdvancedSection.paymentsAdvanced(countryCode)}}" stepKey="waitToClickPaymentAdvanced"/> + <click selector="{{AdminConfigPaymentsAdvancedSection.paymentsAdvanced(countryCode)}}" stepKey="clickPaymentAdvanced"/> + <clearField selector ="{{AdminConfigPaymentsAdvancedSection.email(countryCode)}}" stepKey="clearInputEmailField"/> + <clearField selector ="{{AdminConfigPaymentsAdvancedSection.partner(countryCode)}}" stepKey="clearInputPartnerField"/> + <clearField selector ="{{AdminConfigPaymentsAdvancedSection.vendor(countryCode)}}" stepKey="clearInputVendorField"/> + <clearField selector ="{{AdminConfigPaymentsAdvancedSection.user(countryCode)}}" stepKey="clearInputUsereField"/> + <clearField selector ="{{AdminConfigPaymentsAdvancedSection.password(countryCode)}}" stepKey="clearInputPasswordField"/> + <selectOption selector ="{{AdminConfigPaymentsAdvancedSection.testMode(countryCode)}}" userInput="No" stepKey="disableTestMode"/> + <waitForElementNotVisible selector ="{{AdminConfigPaymentsAdvancedSection.enabledSolution(countryCode)}}" stepKey="seeNoInEnableSolutionWithDisabled"/> + <waitForElementNotVisible selector ="{{AdminConfigPaymentsAdvancedSection.enabledPaypalCredit(countryCode)}}" stepKey="seeNoInEnablePaypalCreditWithDisabled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminClearPaymentsProActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminClearPaymentsProActionGroup.xml new file mode 100644 index 0000000000000..b6ceee5a92ce7 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminClearPaymentsProActionGroup.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClearPaymentsProActionGroup"> + <annotations> + <description>Admin goes to payments pro configuration and clears provided Sample PayPal credentials</description> + </annotations> + <arguments> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> + <waitForPageLoad stepKey="waitForConfigPageLoad"/> + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="clickOtherPayPalPaymentsSection"/> + <waitForElementClickable selector="{{PayPalPaymentsProConfigSection.configureBtn(countryCode)}}" stepKey="waitForPayPalPaymentsProConfigureBtn"/> + <click selector ="{{PayPalPaymentsProConfigSection.configureBtn(countryCode)}}" stepKey="clickPayPalPaymentsProConfigureBtn"/> + <waitForPageLoad stepKey="waitForPaymethodConfigPageLoad"/> + <clearField selector="{{PayPalPaymentsProConfigSection.partner(countryCode)}}" stepKey="clearInputPartnerField"/> + <clearField selector="{{PayPalPaymentsProConfigSection.vendor(countryCode)}}" stepKey="clearInputVendorField"/> + <clearField selector="{{PayPalPaymentsProConfigSection.user(countryCode)}}" stepKey="clearInputUsereField"/> + <clearField selector="{{PayPalPaymentsProConfigSection.password(countryCode)}}" stepKey="clearInputPasswordField"/> + <selectOption selector="{{PayPalPaymentsProConfigSection.testMode(countryCode)}}" userInput="No" stepKey="disableTestMode"/> + <assertElementContainsAttribute stepKey="seeEnablePaymentsProSolutionIsDisabled"> + <expectedResult selector="{{PayPalPaymentsProConfigSection.enableSolution(countryCode)}}" attribute="disabled" type="string"></expectedResult> + </assertElementContainsAttribute> + <seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enableSolution(countryCode)}}" userInput="No" stepKey="seeEnableThisSolutionIsSetAsNo"/> + <assertElementContainsAttribute stepKey="seeEnablePaypalCreditIsDisabled"> + <expectedResult selector="{{PayPalPaymentsProConfigSection.enablePaypalCredit(countryCode)}}" attribute="disabled" type="string"></expectedResult> + </assertElementContainsAttribute> + <seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enablePaypalCredit(countryCode)}}" userInput="No" stepKey="seePaypalCreditIsSetAsNo" after="seeEnablePaypalCreditIsDisabled"/> + <assertElementContainsAttribute stepKey="seeEnableVaultIsDisabled"> + <expectedResult selector="{{PayPalPaymentsProConfigSection.enableVault(countryCode)}}" attribute="disabled" type="string"></expectedResult> + </assertElementContainsAttribute> + <seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enableVault(countryCode)}}" userInput="No" stepKey="seeValultIsSetAsNo" after="seeEnableVaultIsDisabled"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminConfigPaymentsAdvancedActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminConfigPaymentsAdvancedActionGroup.xml new file mode 100644 index 0000000000000..7a6e89a6627bf --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminConfigPaymentsAdvancedActionGroup.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminConfigPaymentsAdvancedActionGroup"> + <annotations> + <description>Goes to the 'Configuration' page for 'Payment Methods'. Fills in the provided Sample PayPal credentials and other details. Clicks on Save.</description> + </annotations> + <arguments> + <argument name="credentials" defaultValue="SamplePaypalPaymentsAdvancedConfig"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> + <waitForPageLoad stepKey="waitForConfigPageLoad"/> + <waitForElementVisible selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" stepKey="waitForOtherPayPalPaymentsSection"/> + <conditionalClick selector="{{OtherPayPalPaymentsConfigSection.expandTab(countryCode)}}" dependentSelector="{{OtherPayPalPaymentsConfigSection.expandedTab(countryCode)}}" visible="false" stepKey="expandOtherPaypalConfigButton"/> + <waitForElementClickable selector="{{PaymentsAdvancedConfigSection.configBtn(countryCode)}}" stepKey="waitForPayPalPaymentsAdvancedConfigureBtn"/> + <click selector ="{{PaymentsAdvancedConfigSection.configBtn(countryCode)}}" stepKey="clickPayPalPaymentsAdvancedConfigureBtn"/> + <scrollTo selector="{{PaymentsAdvancedConfigSection.partner(countryCode)}}" stepKey="scrollToBottom"/> + <waitForElementVisible selector="{{PaymentsAdvancedConfigSection.partner(countryCode)}}" stepKey="waitForPartner"/> + <fillField selector ="{{PaymentsAdvancedConfigSection.partner(countryCode)}}" userInput="{{credentials.payflow_advanced_partner}}" stepKey="inputPartner"/> + <waitForElementVisible selector="{{PaymentsAdvancedConfigSection.vendor(countryCode)}}" stepKey="waitForVendor"/> + <fillField selector ="{{PaymentsAdvancedConfigSection.vendor(countryCode)}}" userInput="{{credentials.payflow_advanced_vendor}}" stepKey="inputVendor"/> + <waitForElementVisible selector="{{AdminConfigurepaymentsAdvancedSection.user(countryCode)}}" stepKey="waitForUser"/> + <fillField selector ="{{AdminConfigurepaymentsAdvancedSection.user(countryCode)}}" userInput="{{credentials.payflow_advanced_user}}" stepKey="inputUser"/> + <waitForElementVisible selector="{{AdminConfigurepaymentsAdvancedSection.password(countryCode)}}" stepKey="waitForPassword"/> + <fillField selector ="{{AdminConfigurepaymentsAdvancedSection.password(countryCode)}}" userInput="{{credentials.payflow_advanced_password}}" stepKey="inputPassword"/> + <selectOption selector="{{PaymentsAdvancedConfigSection.testMode(countryCode)}}" userInput="Yes" stepKey="enableTestMode"/> + <waitForPageLoad stepKey="waitForPageLoadForEnableSolution"/> + <selectOption selector ="{{PaymentsAdvancedConfigSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> + <selectOption selector ="{{PaymentsAdvancedConfigSection.enablePaypalexp(countryCode)}}" userInput="Yes" stepKey="enablePaypalExperiencelater"/> + <waitForPageLoad stepKey="waitForAdvisePageLoad"/> + <waitForPageLoad stepKey="waitForAdvisepaylaterExpand"/> + <click selector ="{{PaymentsAdvancedConfigSection.advisepaylaterBtn(countryCode)}}" stepKey="clickPayPalPaymentsAdvisepaylatereBtn"/> + <selectOption selector ="{{PaymentsAdvancedConfigSection.payLaterConfigDropDown(countryCode)}}" userInput="Yes" stepKey="enablePaypalPaylater"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminEnablePaymentAdvancedConfigurationActionGroup.xml b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminEnablePaymentAdvancedConfigurationActionGroup.xml new file mode 100644 index 0000000000000..0dcb34c46519d --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/ActionGroup/AdminEnablePaymentAdvancedConfigurationActionGroup.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminEnablePaymentAdvancedConfigurationActionGroup"> + <annotations> + <description>Configuration for Payments Advanced and Paypal credit Sample PayPal credentials</description> + </annotations> + <arguments> + <argument name="credentials" defaultValue="SamplePaypalPaymentsAdvancedConfig"/> + <argument name="countryCode" type="string" defaultValue="us"/> + </arguments> + <scrollTo selector="{{AdminConfigPaymentsAdvancedSection.partner(countryCode)}}" stepKey="scrollToBottom"/> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.partner(countryCode)}}" stepKey="waitForPartner"/> + <fillField selector ="{{AdminConfigPaymentsAdvancedSection.partner(countryCode)}}" userInput="{{credentials.payflow_advanced_partner}}" stepKey="inputPartner"/> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.vendor(countryCode)}}" stepKey="waitForVendor"/> + <fillField selector ="{{AdminConfigPaymentsAdvancedSection.vendor(countryCode)}}" userInput="{{credentials.payflow_advanced_vendor}}" stepKey="inputVendor"/> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.user(countryCode)}}" stepKey="waitForUser"/> + <fillField selector ="{{AdminConfigPaymentsAdvancedSection.user(countryCode)}}" userInput="{{credentials.payflow_advanced_user}}" stepKey="inputUser"/> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.password(countryCode)}}" stepKey="waitForPassword"/> + <fillField selector ="{{AdminConfigPaymentsAdvancedSection.password(countryCode)}}" userInput="{{credentials.payflow_advanced_password}}" stepKey="inputPassword"/> + <selectOption selector="{{AdminConfigPaymentsAdvancedSection.testMode(countryCode)}}" userInput="Yes" stepKey="enableTestMode"/> + <wait time="10" stepKey="waitToEnableAdvanced"/> + <waitForElementNotVisible selector ="{{AdminConfigPaymentsAdvancedSection.solution(countryCode)}}" stepKey="activeEnableSolutions"/> + <waitForElementNotVisible selector ="{{AdminConfigPaymentsAdvancedSection.enabledPaypalCredit(countryCode)}}" stepKey="disablePaypalCredit"/> + <waitForPageLoad stepKey="waitForPageLoadForEnableSolution"/> + <selectOption selector ="{{AdminConfigPaymentsAdvancedSection.enableSolution(countryCode)}}" userInput="Yes" stepKey="enableSolution"/> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.greenCheckMrk(countryCode)}}" stepKey="assertGreenTickMarkPresentForEnableThisSolutionDropdown"/> + <waitForElementNotVisible selector ="{{AdminConfigPaymentsAdvancedSection.solution(countryCode)}}" stepKey="assertEnabledSolutions"/> + <waitForElementNotVisible selector ="{{AdminConfigPaymentsAdvancedSection.paypalCredit(countryCode)}}" stepKey="enablePaypalCredit"/> + <waitForElementVisible selector ="{{AdminConfigPaymentsAdvancedSection.sortOrder(countryCode)}}" stepKey="assertSortOrderPaypalCredit"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Paypal/Test/Mftf/Section/AdminConfigPaymentsAdvancedSection.xml b/app/code/Magento/Paypal/Test/Mftf/Section/AdminConfigPaymentsAdvancedSection.xml new file mode 100644 index 0000000000000..6703453027133 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/Section/AdminConfigPaymentsAdvancedSection.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminConfigPaymentsAdvancedSection"> + <element name="paymentsAdvanced" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced-head" parameterized="true"/> + <element name="paymentsPro" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk-head" parameterized="true"/> + <element name="paymentsStandard" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wps_express-head" parameterized="true"/> + <element name="email" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_payments_advanced_business_account" parameterized="true"/> + <element name="partner" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_payments_advanced_partner" parameterized="true"/> + <element name="user" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_payments_advanced_user" parameterized="true"/> + <element name="vendor" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_payments_advanced_vendor" parameterized="true"/> + <element name="password" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_payments_advanced_pwd" parameterized="true"/> + <element name="testMode" type="select" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_payments_advanced_sandbox_flag" parameterized="true" /> + <element name="paypalAllInOne" type="input" selector="//*[contains(@id, 'payment_{{countryCode}}_paypal_group_all_in_one-head')]" parameterized="true" /> + <element name="paypalPaymentGatewayLink" type="button" selector="//*[contains(@id, 'payment_{{countryCode}}_paypal_payment_gateways-head')]" parameterized="true" /> + <element name="enableSolution" type="select" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_enable_payflow_advanced" parameterized="true"/> + <element name="greenCheckMrk" type="select" selector="//*[contains(@id,'payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_enable_payflow_advanced')]//label[@class='enabled']" parameterized="true"/> + <element name="enablePaypalCredit" type="select" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_enable_express_checkout_bml" parameterized="true"/> + <element name="disabledPaypalCredit" type="select" selector="//select[contains(@id,'payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_enable_express_checkout_bml')]//label[@class='enabled']" parameterized="true"/> + <element name="enabledSolution" type="select" selector="//select[contains(@id,'payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_enable_payflow_advanced')]//label[@class='enabled']" parameterized="true"/> + <element name="enabledPaypalCredit" type="select" selector="//select[contains(@id,'payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_enable_express_checkout_bml')]//label[@class='enabled']" parameterized="true"/> + <element name="solution" type="select" selector="//select[contains(@id,'payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_enable_payflow_advanced')]//label[@class='disabled']" parameterized="true"/> + <element name="paypalCredit" type="select" selector="//select[contains(@id,'payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_enable_express_checkout_bml')]//label[@class='disabled']" parameterized="true"/> + <element name="payFlowEdition" type="button" selector="//span[contains(text(), 'PayPal Express Checkout Payflow Edition')]"/> + <element name="payFlowExpress" type="button" selector="//span[contains(text(), 'PayPal Credit (Payflow Express Bml)')]"/> + <element name="creditCardPayflowAdvanced" type="button" selector="//span[contains(text(), 'Credit Card (Payflow Advanced)')]"/> + <element name="sortOrder" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_express_checkout_bml_sort_order" parameterized="true"/> + <element name="closeButton" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced-head span[class='state-opened']" parameterized="true"/> + </section> +</sections> diff --git a/app/code/Magento/Paypal/Test/Mftf/Section/CheckoutPaymentSection.xml b/app/code/Magento/Paypal/Test/Mftf/Section/CheckoutPaymentSection.xml index 202f7bfa90596..cf144fad95a1d 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Section/CheckoutPaymentSection.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Section/CheckoutPaymentSection.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. + * Copyright 2024 Adobe + * All Rights Reserved. */ --> @@ -74,5 +74,7 @@ <element name="productQuantityInCartBlock" type="text" selector="//div[@class='details-qty']/span[@class='value']" /> <element name="productChargedFor" type="text" selector="tr.totals.charge span.price"/> <element name="productCharged" type="text" selector="//tr[@class='grand totals']//span[@class='price' and contains(text(),'HK$')]"/> + <element name="reviewOrder" type="button" selector="//div//button[text()='Continue to Review Order']"/> + <element name="checkoutWithPaypal" type="button" selector="(//div[@class='cart-container']//input[@data-action='checkout-form-submit'])[1]" timeout="30"/> </section> </sections> diff --git a/app/code/Magento/Paypal/Test/Mftf/Section/PayPalPaymentsProConfigSection.xml b/app/code/Magento/Paypal/Test/Mftf/Section/PayPalPaymentsProConfigSection.xml index cf8e594598470..8351ffbe4aae3 100755 --- a/app/code/Magento/Paypal/Test/Mftf/Section/PayPalPaymentsProConfigSection.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Section/PayPalPaymentsProConfigSection.xml @@ -16,5 +16,13 @@ <element name="testMode" type="select" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk_paypal_payflow_required_paypal_payflow_api_settings_sandbox_flag" parameterized="true"/> <element name="enableSolution" type="select" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk_paypal_payflow_required_enable_paypal_payflow" parameterized="true"/> <element name="paymentsAdvanced" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced-head" parameterized="true"/> + <element name="enablePaypalCredit" type="select" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk_paypal_payflow_required_enable_express_checkout_bml_payflow" parameterized="true"/> + <element name="enableVault" type="select" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk_paypal_payflow_required_payflowpro_cc_vault_active" parameterized="true"/> + <element name="disabledEnableSolution" type="select" selector="//*[contains(@id,'payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk_paypal_payflow_required_enable_paypal_payflow')]//label[@class='enabled']" parameterized="true"/> + <element name="disabledPaypalCredit" type="select" selector="//*[contains(@id,'payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk_paypal_payflow_required_enable_express_checkout_bml_payflow')]//label[@class='enabled']" parameterized="true"/> + <element name="disabledVault" type="select" selector="//*[contains(@id,'payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk_paypal_payflow_required_payflowpro_cc_vault_active')]//label[@class='enabled']" parameterized="true"/> + <element name="closeButton" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk-head span[class='state-opened']" parameterized="true"/> + <element name="sortOrder" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_wpp_usuk_paypal_payflow_required_express_checkout_bml_sort_order" parameterized="true"/> + <element name="paypalAllInOnePaymentSolutions" type="input" selector="//*[contains(@id, 'payment_{{countryCode}}_paypal_group_all_in_one-head')]" parameterized="true" /> </section> </sections> diff --git a/app/code/Magento/Paypal/Test/Mftf/Section/PaymentsAdvancedConfigSection.xml b/app/code/Magento/Paypal/Test/Mftf/Section/PaymentsAdvancedConfigSection.xml new file mode 100644 index 0000000000000..ef4610ee47585 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/Section/PaymentsAdvancedConfigSection.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="PaymentsAdvancedConfigSection"> + <element name="configBtn" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced-head" parameterized="true"/> + <element name="email" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_payments_advanced_business_account" parameterized="true"/> + <element name="partner" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_payments_advanced_partner" parameterized="true"/> + <element name="vendor" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_payments_advanced_vendor" parameterized="true"/> + <element name="testMode" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_payments_advanced_sandbox_flag" parameterized="true" /> + <element name="enableSolution" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_enable_payflow_advanced" parameterized="true" /> + <element name="enablePaypalexp" type="input" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_enable_paypal_paylater_experience" parameterized="true" /> + <element name="advisepaylaterBtn" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_advanced_advertise_paylater-head" parameterized="true" /> + <element name="payLaterConfigDropDown" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_advanced_advertise_paylater_paylater_enabled" parameterized="true"/> + <element name="cartBtn" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_advanced_advertise_paylater_advanced_settings_paylater_cartpage-head" parameterized="true"/> + <element name="payLaterDisplay" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_advanced_advertise_paylater_advanced_settings_paylater_cartpage_paylater_cartpage_display" parameterized="true"/> + <element name="displayOption" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_advanced_advertise_paylater_advanced_settings_paylater_cartpage_paylater_cartpage_display" parameterized="true"/> + <element name="payLaterMessage" type="input" selector="//span[text()='Buy now, pay later.']"/> + <element name="positionOption" type="button" selector="#payment_{{countryCode}}_paypal_group_all_in_one_payflow_advanced_required_settings_advanced_advertise_paylater_advanced_settings_paylater_cartpage_paylater_cartpage_position" parameterized="true"/> + <element name="payPalCheckoutField" type="text" selector="//*[@id='maincontent']/div[3]/div/div[2]/div[1]/ul/li[2]/div[1]/input"/> + <element name="payPalFrame" type="iframe" selector="//iframe[contains(@id, 'jsx-iframe')]"/> + </section> +</sections> diff --git a/app/code/Magento/Paypal/Test/Mftf/Section/StorefrontPayPalOrderReviewSection.xml b/app/code/Magento/Paypal/Test/Mftf/Section/StorefrontPayPalOrderReviewSection.xml index d739a5731e052..88fae0ad4c955 100644 --- a/app/code/Magento/Paypal/Test/Mftf/Section/StorefrontPayPalOrderReviewSection.xml +++ b/app/code/Magento/Paypal/Test/Mftf/Section/StorefrontPayPalOrderReviewSection.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. + * Copyright 2024 Adobe + * All Rights Reserved. */ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" @@ -10,6 +10,10 @@ <section name="StorefrontPayPalOrderReviewSection"> <element name="shippingMethod" type="select" selector="#shipping-method"/> <element name="placeOrderBtn" type="button" selector="#review-button" timeout="30"/> + <element name="applyDiscountCodeHeader" type="select" selector="//strong[text()='Apply Discount Code']"/> + <element name="discountCodeField" type="input" selector=".control #coupon_code"/> + <element name="applyDiscount" type="button" selector="//button//span[text()='Apply Discount']"/> + <element name="grandTotal" type="text" selector="//td[@data-th='Grand Total']//strong"/> </section> </sections> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminCancelSalesOrderPlacedWithPayPalPaymentsProTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminCancelSalesOrderPlacedWithPayPalPaymentsProTest.xml new file mode 100644 index 0000000000000..c744b1adff953 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminCancelSalesOrderPlacedWithPayPalPaymentsProTest.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCancelSalesOrderPlacedWithPayPalPaymentsProTest"> + <annotations> + <features value="PayPal"/> + <stories value="Paypal Payments Pro"/> + <title value="Cancel Sales Order placed with PayPal Payments Pro"/> + <description value="Cancel Sales Order placed with PayPal Payments Pro and validate message in trasaction tab from backend"/> + <severity value="MAJOR"/> + <testCaseId value="AC-13333"/> + <group value="paypalPaymentsPro"/> + <group value="3rd_party_integration"/> + <group value="pr_exclude"/> + </annotations> + <before> + <createData entity="SimpleProduct" stepKey="createSimpleProduct"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="goToProductOnStorefront"> + <argument name="product" value="$$createSimpleProduct$$"/> + </actionGroup> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> + <argument name="productName" value="$createSimpleProduct.name$"/> + </actionGroup> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/> + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/> + <!--Place order--> + <actionGroup ref="GuestCheckoutFillingShippingSectionActionGroup" stepKey="guestCheckoutFillingShipping"> + <argument name="shippingMethod" value="Flat Rate"/> + </actionGroup> + <actionGroup ref="StorefrontCheckoutSelectPaypalPaymentMethodActionGroup" stepKey="selectPaypalPaymentMethod"/> + <waitForPageLoad stepKey="waitForLoadingMaskAfterPaymentMethodSelection"/> + <actionGroup ref="StorefrontPaypalFillCardDataActionGroup" stepKey="fillCardDataPaypal"> + <argument name="cardData" value="VisaDefaultCard"/> + </actionGroup> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="placeOrder"/> + <waitForText selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> + <waitForText selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessMessage"/> + <waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="waitForOrderNumber"/> + </before> + <after> + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="clickOnRemoveButtonToUnFiltersIfPresent"/> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <!--Open order in sales --> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrder"> + <argument name="orderId" value="{$grabOrderNumber}"/> + </actionGroup> + <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOption"> + <argument name="orderStatus" value="Canceled"/> + </actionGroup> + <!--Grab the transaction id--> + <waitForElementVisible selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="waitForTransactionIDFieldToBeAppeared"/> + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.paymentInformationField('Last Transaction ID')}}" stepKey="grabTransactionID"/> + <actionGroup ref="AdminOpenOrderCommentsHistoryActionGroup" stepKey="clickOnCommentsHistory"/> + <waitForText selector="{{AdminOrderCommentsTabSection.orderCommentsWithType('Canceled order')}}" userInput="Canceled order online Amount: $128.00. Transaction ID: "{$grabTransactionID}"" stepKey="seeOrderHistoryNotesAfterCancelingOrder"/> + <actionGroup ref="AdminOpenTransactionsTabActionGroup" stepKey="openTransactionTypeHasAuthorization"> + <argument name="transactionType" value="authorization"/> + </actionGroup> + <waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForAuthorization"/> + <waitForElementClickable selector="{{AdminProductFormActionSection.backButton}}" stepKey="waitForBackButtonToBeClicked"/> + <click selector="{{AdminProductFormActionSection.backButton}}" stepKey="clickBackButton"/> + <actionGroup ref="AdminOpenTransactionsTabActionGroup" stepKey="openTransactionTypeHasVoid"> + <argument name="transactionType" value="void"/> + </actionGroup> + <waitForText selector="{{AdminTransactionsGridSection.transactionData('Is Closed')}}" userInput="Yes" stepKey="seeIfClosedHeaderIsSetAsYesForVoid"/> + </test> +</tests> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminCheckConfigPaymentsProInUnitedstatesTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminCheckConfigPaymentsProInUnitedstatesTest.xml new file mode 100644 index 0000000000000..53cac5729420f --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminCheckConfigPaymentsProInUnitedstatesTest.xml @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCheckConfigPaymentsProInUnitedstatesTest"> + <annotations> + <features value="PayPal"/> + <stories value="Payment methods"/> + <title value="Check config for payments pro in Unites States"/> + <description value="Check paypal payments pro payment option's enablement and disablement based on the configuration setting For Payments Pro in backend"/> + <severity value="MAJOR"/> + <testCaseId value="AC-4790"/> + <group value="3rd_party_integration" /> + <group value="pr_exclude" /> + </annotations> + <before> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="SimpleProduct" stepKey="simpleProduct"/> + + <magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountry"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <magentoCLI command="config:set payment/paypal_payment_pro/active 0" stepKey="disablePayPalPaymentsPro"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + </after> + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPage"/> + <waitForPageLoad stepKey="waitForConfigPageLoad"/> + <actionGroup ref="AdminAssertPaypalAllInOnePaymentMethodActionGroup" stepKey="AssertPayAllInOneLink"/> + <!--Clear paypal details config related data--> + <actionGroup ref="AdminClearPaymentsProActionGroup" stepKey="clearExistingDataForPaymentsPro"/> + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/> + <actionGroup ref="AdminAssertPaypalCreditPaymentsProActionGroup" stepKey="enablePaypalPaymentsPro"/> + <!--Save Configuration--> + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfigs"/> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="runIndexCronJobs"> + <argument name="indices" value=""/> + </actionGroup> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <waitForElementNotVisible selector="{{PayPalPaymentsProConfigSection.closeButton('us')}}" stepKey="assertConfigureBtnIsDisabled"/> + <!--Login to storefront as guest customer--> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> + <waitForPageLoad stepKey="waitForProductPage"/> + <!--Add simple product--> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> + <argument name="product" value="$simpleProduct$"/> + </actionGroup> + <!--Open cart page and proceed to checkout--> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/> + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/> + <!--Fill Shipping Address--> + <actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillShippingAddress"> + <argument name="customer" value="$$createCustomer$$" /> + <argument name="address" value="US_Address_TX"/> + </actionGroup> + <!-- Select shipping --> + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectShippingMethodAsFlatRate"> + <argument name="shippingMethodName" value="Flat Rate"/> + </actionGroup> + <!-- Go to Order review --> + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/> + <waitForPageLoad stepKey="waitForLoadingPaypalPaymentPage"/> + <!-- Assert Payflow Edition, Paypal Pro and Paypal Credit Payment method --> + <waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout Payflow Edition')}}" stepKey="assertPayPalExpressCheckoutPayflowEdition"/> + <waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Credit')}}" stepKey="assertPaypalCreditPaymentMethod"/> + <waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Credit Card (Payflow Pro)')}}" stepKey="assertPaypalPaymentsProPaymentMethod"/> + <magentoCLI command="config:set payment/paypal_payment_pro/active 0" stepKey="disablePaymentsPro"/> + <magentoCLI command="config:set payment/payflow_express_bml/active 0" stepKey="disablePaypalCredit"/> + <magentoCLI command="config:set payment/payflow_express/active 0" stepKey="disableExpressCheckout"/> + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPageAfterDisablingPayPalExpressCheckout"/> + <waitForPageLoad stepKey="waitForPaymentMethodPageToLoad"/> + <waitForElementClickable selector="{{PayPalPaymentsProConfigSection.configureBtn('us')}}" stepKey="waitForClickPayPalConfigureBtnToAssertStatus"/> + <click selector="{{PayPalPaymentsProConfigSection.configureBtn('us')}}" stepKey="clickPayPalConfigureBtnToAssertStatus"/> + <!-- Disable PaymentsPro and Assert Green Checkmark --> + <waitForElementNotVisible selector="{{PayPalPaymentsProConfigSection.disabledEnableSolution('us')}}" stepKey="assertNoGreenTickMarkForEnableThisSolutionDropdown"/> + <assertElementContainsAttribute stepKey="seePaypalCreditIsDisabled"> + <expectedResult selector="{{PayPalPaymentsProConfigSection.enablePaypalCredit('us')}}" attribute="disabled" type="string"></expectedResult> + </assertElementContainsAttribute> + <seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enablePaypalCredit('us')}}" userInput="No" stepKey="seePaypalCreditIsSetAsNo"/> + <waitForElementNotVisible selector="{{PayPalPaymentsProConfigSection.disabledPaypalCredit('us')}}" stepKey="assertGreenTickMarkPresentForPaypalCreditDropdown"/> + <waitForElementNotVisible selector="{{PayPalPaymentsProConfigSection.sortOrder('us')}}" stepKey="assertSortOrderFieldIsDisappeared"/> + <seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enableVault('us')}}" userInput="Yes" stepKey="seeValultIsSetAsNo"/> + <waitForElementVisible selector="{{PayPalPaymentsProConfigSection.disabledVault('us')}}" stepKey="assertGreenTickMarkPresentForEnableVaultDropdown"/> + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfiguration"/> + <waitForElementVisible selector="{{PayPalPaymentsProConfigSection.configureBtn('us')}}" stepKey="assertConfigureVisible"/> + <!-- Assert No Other Paypal Payments Methods Available in Storefront --> + <actionGroup ref="StorefrontNavigateToGuestCheckoutReviewAndPaymentsPageActionGroup" stepKey="goToStoreFrontCheckoutPageToAssertPaypalPaymentMethodIsDisappeared"/> + <waitForElementNotVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout Payflow Edition')}}" stepKey="assertPayPalPaymentIsAbsent"/> + <waitForElementNotVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Credit')}}" stepKey="assertPaypalCreditPaymentMethodIsAbsent"/> + <waitForElementNotVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Credit Card (Payflow Pro)')}}" stepKey="assertPaypalPaymentsProPaymentMethodIsAbsent"/> + <!--Set Paypal Credit to No and assert the status--> + <magentoCLI command="config:set payment/payflowpro/sandbox_flag 1" stepKey="enableSandboxMode"/> + <magentoCLI command="config:set payment/paypal_payment_pro/active 1" stepKey="enablePaymentsProSolution"/> + <magentoCLI command="config:set payment/payflow_express_bml/active 1" stepKey="enablePayPalPaymentMethod"/> + <magentoCLI command="config:set payment/payflow_express/active 1" stepKey="enablePayflowEdition"/> + <magentoCLI command="config:set payment/payflow_express_bml/active 0" stepKey="disablePayPalCreditPaymentMethod"/> + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPageAfterEnablingPaypal"/> + <waitForPageLoad stepKey="waitForPaymentMethodPageToLoadAfterEnabling"/> + <waitForElementNotVisible selector="{{PayPalPaymentsProConfigSection.closeButton('us')}}" stepKey="assertConfigeBtnNotVisible"/> + <waitForElementClickable selector="{{PayPalPaymentsProConfigSection.configureBtn('us')}}" stepKey="waitForClickPayPalConfigureBtnToAssertStatusAfterEnabling"/> + <click selector="{{PayPalPaymentsProConfigSection.configureBtn('us')}}" stepKey="clickPayPalConfigureBtnToAssertStatusAfterEnabling"/> + <waitForElementVisible selector="{{PayPalPaymentsProConfigSection.disabledEnableSolution('us')}}" stepKey="assertGreenTickMarkForEnableThisSolutionDropdown"/> + <seeOptionIsSelected selector="{{PayPalPaymentsProConfigSection.enablePaypalCredit('us')}}" userInput="No" stepKey="seeEnablePaypalCreditIsSetAsNo"/> + <waitForElementNotVisible selector="{{PayPalPaymentsProConfigSection.disabledPaypalCredit('us')}}" stepKey="assertGreenTickMarkAbsentForPaypalCreditDropdown"/> + <waitForElementVisible selector="{{PayPalPaymentsProConfigSection.disabledVault('us')}}" stepKey="assertGreenTickMarkForEnableVaultDropdown"/> + <waitForElementVisible selector="{{PayPalPaymentsProConfigSection.closeButton('us')}}" stepKey="assertConfigBtnIsDisabled"/> + <!--Go to checkout page and assert paypal express checkout Payflow Edition and Credit Card option is present--> + <actionGroup ref="StorefrontNavigateToGuestCheckoutReviewAndPaymentsPageActionGroup" stepKey= "goToStoreFrontCheckoutPageToAssertPaypalPaymentMethodIsPresent"/> + <waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout Payflow Edition')}}" stepKey="assertPayPalExpressPayflowEdition"/> + <waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('Credit Card (Payflow Pro)')}}" stepKey="creditcardPaymentsPro"/> + </test> +</tests> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminCheckOfflineRefundWarningForPayPalExpressCheckoutTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminCheckOfflineRefundWarningForPayPalExpressCheckoutTest.xml new file mode 100644 index 0000000000000..c5e17862c2da1 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminCheckOfflineRefundWarningForPayPalExpressCheckoutTest.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCheckOfflineRefundWarningForPayPalExpressCheckoutTest"> + <annotations> + <features value="PayPal"/> + <stories value="Checking offline refund warning while refunding with credit memo"/> + <title value="Admin verify refund warning message"/> + <description value="Admin Checking offline refund warning for PayPal Express Checkout orders"/> + <severity value="CRITICAL"/> + <testCaseId value="AC-4375"/> + <group value="3rd_party_integration"/> + <group value="paypalExpress"/> + <group value="pr_exclude"/> + </annotations> + <before> + <!-- Simple product is created --> + <createData entity="simpleProductWithoutCategory" stepKey="createProduct"> + <field key="price">10.00</field> + </createData> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <!-- Roll back configuration --> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <!-- Navigate to StoreFront --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> + <!-- Add product to cart --> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/> + <!--Fill Shipping Address--> + <actionGroup ref="FillGuestCheckoutShippingAddressFormActionGroup" stepKey="fillShippingAddress"/> + <selectOption selector="{{CheckoutCartSummarySection.stateProvince}}" userInput="Texas" stepKey="fillState"/> + <waitForPageLoad stepKey="waitForShippingPageToLoad"/> + <!-- Click Next button --> + <actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> + <!-- Click on PayPal payment radio button --> + <waitForElementClickable selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="waitForPayPalRadioButton"/> + <click selector="{{CheckoutPaymentSection.PayPalPaymentRadio}}" stepKey="selectPaypalPayment"/> + <actionGroup ref="SwitchToPayPalGroupBtnActionGroup" stepKey="clickPayPalBtn"/> + <!-- Login to Paypal in-context and verify order total on paypal page--> + <actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="loginToPayPal"/> + <actionGroup ref="StorefrontPaypalSwitchBackToMagentoFromCheckoutPageActionGroup" stepKey="confirmPaymentAndGoBackToMagento"/> + <waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="waitForOrderNumberToBeGrabbed"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> + <waitForText selector="{{CheckoutSuccessMainSection.success}}" userInput="We'll email you an order confirmation with details and tracking info." stepKey="seeSuccessMessage"/> + <!--Assert order in orders grid --> + <!-- Go to order page --> + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="openFirstOrderPage"> + <argument name="orderId" value="{$grabOrderNumber}"/> + </actionGroup> + <!-- Check status --> + <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="seeAdminOrderStatus"> + <argument name="status" value="Processing"/> + </actionGroup> + <!-- Create invoice with capture online amount --> + <waitForElementVisible selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="waitForInvoicebtn"/> + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoice"/> + <waitForPageLoad stepKey="waitForInvoicePage"/> + <scrollTo selector="{{AdminInvoiceMainActionsSection.selectModeOfAmount}}" x="0" y="-80" stepKey="scrollToAmount"/> + <selectOption userInput="Capture Online" selector="{{AdminInvoiceMainActionsSection.selectModeOfAmount}}" stepKey="selectCaptureOnlineUnderAmount"/> + <waitForElementVisible selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="waitForSubmitInvoicebtn"/> + <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="submitInvoice"/> + <waitForPageLoad stepKey="waitForLoadPage"/> + <waitForText userInput="The invoice has been created." stepKey="seeMessageInvoiceCreated"/> + <!-- Admin verify offline refund warning after clicking on credit memo --> + <waitForElementVisible selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="waitForCreditMemobtn"/> + <click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickOnCreditMemobtn"/> + <waitForText userInput="This will create an offline refund. To create an online refund, open an invoice and create credit memo for it. Do you want to continue?" selector="{{AdminOrderDetailsMainActionsSection.creditMemoWarning}}" stepKey="waitForOfflineRefundWarning"/> + </test> +</tests> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminCloseOrderForPartialRefundTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminCloseOrderForPartialRefundTest.xml new file mode 100644 index 0000000000000..6cb545c0ea8c3 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminCloseOrderForPartialRefundTest.xml @@ -0,0 +1,145 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCloseOrderForPartialRefundTest"> + <annotations> + <features value="PayPal"/> + <stories value="Close Order for Partial refund"/> + <title value="Check Close order placed if refunded partially"/> + <description value="Check the Closed Order Status If an order is refunded partially"/> + <severity value="MAJOR"/> + <testCaseId value="AC-12940"/> + </annotations> + <before> + <!-- Create category --> + <createData entity="_defaultCategory" stepKey="createCategory"/> + <!-- Simple product is created --> + <createData entity="SimpleProductWithWeight" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <!-- Create Configurable Product --> + <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> + <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </createData> + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + </getData> + <createData entity="ApiSimpleProductWithPrice1" stepKey="createConfigChildProduct"> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption"/> + <requiredEntity createDataKey="createCategory"/> + </createData> + <createData entity="ConfigurableProductTwoOptions" stepKey="createConfigProductOption"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigProductAttribute"/> + <requiredEntity createDataKey="getConfigAttributeOption"/> + </createData> + <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild"> + <requiredEntity createDataKey="createConfigProduct"/> + <requiredEntity createDataKey="createConfigChildProduct"/> + </createData> + <!-- US Customer is created --> + <createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="runIndexCronJob"> + <argument name="indices" value="cataloginventory_stock"/> + </actionGroup> + <!-- Login to StoreFront --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <!-- Add product to cart --> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addProductToCart"> + <argument name="product" value="$$createProduct$$"/> + </actionGroup> + <!-- Add configurable product to the cart --> + <actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart"> + <argument name="urlKey" value="$$createConfigProduct.custom_attributes[url_key]$$" /> + <argument name="productAttribute" value="$$createConfigProductAttribute.default_value$$"/> + <argument name="productOption" value="$$getConfigAttributeOption.value$$"/> + <argument name="qty" value="1"/> + </actionGroup> + <!-- Go to Checkout Page --> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/> + <!-- Select shipping --> + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatrate"> + <argument name="shippingMethodName" value="Flat Rate"/> + </actionGroup> + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="clickNext"/> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"/> + <!-- I see order successful Page --> + <actionGroup ref="AssertStorefrontCheckoutSuccessActionGroup" stepKey="assertOrderSuccess"/> + <!-- Grab order number--> + <waitForElementVisible selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="waitForOderNumber"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> + <argument name="tags" value=""/> + </actionGroup> + <!-- Login to admin--> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!--Go to Admin and check order information--> + <actionGroup ref="FilterOrderGridByIdActionGroup" stepKey="filterOrderGrid"> + <argument name="orderId" value="$grabOrderNumber"/> + </actionGroup> + <actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/> + <!-- Go to invoice tab and fill data --> + <actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceAction"/> + <actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/> + <!-- Assert invoice with shipment success message --> + <waitForText selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/> + <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="checkOrderStatus"> + <argument name="status" value="Processing"/> + </actionGroup> + </before> + <after> + <!-- Reset shipping origin --> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <!-- Delete configurable product data --> + <deleteData createDataKey="createConfigChildProduct" stepKey="deleteConfigChildProduct"/> + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> + <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <!-- Delete category --> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <!--Create Credit Memo--> + <actionGroup ref="AdminStartToCreateCreditMemoFromOrderPageActionGroup" stepKey="startCreatingCreditMemo"/> + <waitForElementVisible selector="{{AdminCreditMemoItemsSection.itemQtyToRefund('1')}}" stepKey="waitToItemToRefundTextField"/> + <fillField selector="{{AdminCreditMemoItemsSection.itemQtyToRefund('1')}}" userInput="0" stepKey="partialRefund"/> + <waitForElementClickable selector="{{AdminCreditMemoItemsSection.updateQty}}" stepKey="waitToClickUpdateQuantity"/> + <click selector="{{AdminCreditMemoItemsSection.updateQty}}" stepKey="updateQuantityToRefund"/> + <fillField selector="{{AdminCreditMemoTotalSection.refundShipping}}" userInput="0" stepKey="setRefundShipping"/> + <actionGroup ref="UpdateCreditMemoTotalsActionGroup" stepKey="updateTotals"/> + <actionGroup ref="SubmitCreditMemoActionGroup" stepKey="submitCreditMemo"/> + <actionGroup ref="AdminOpenCreditMemoFromOrderPageActionGroup" stepKey="openCreditMemoFromOrderPageActionGroup"/> + <click selector="{{AdminInvoiceTotalSection.backButton}}" stepKey="clickBackButton"/> + <waitForPageLoad stepKey="waitForViewCreditMemoPageLoad"/> + <actionGroup ref="AdminStartToCreateCreditMemoFromOrderPageActionGroup" stepKey="createAgainCreditMemo"/> + <actionGroup ref="SubmitCreditMemoActionGroup" stepKey="submitAgainCreditMemo"/> + <actionGroup ref="AdminOpenCreditMemoFromOrderPageActionGroup" stepKey="openAgainCreditMemoFromOrderPageActionGroup"/> + <!-- Check status --> + <actionGroup ref="AdminOrderViewCheckStatusActionGroup" stepKey="seeAdminOrderStatus"> + <argument name="status" value="Closed"/> + </actionGroup> + </test> +</tests> + diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsAdvancedForPaypalCreditTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsAdvancedForPaypalCreditTest.xml new file mode 100644 index 0000000000000..ffee06514f33a --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsAdvancedForPaypalCreditTest.xml @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminConfigPaymentsAdvancedForPaypalCreditTest"> + <annotations> + <features value="PayPal"/> + <stories value="Payment methods"/> + <title value="Check config for PayPal Credit in Unites States"/> + <description value="Check paypal Credit payment option's enablement and disablement based on the configuration setting in backend"/> + <severity value="MAJOR"/> + <testCaseId value="AC-5151"/> + <group value="3rd_party_integration" /> + <group value="pr_exclude" /> + </annotations> + <before> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="SimpleProduct" stepKey="simpleProduct"/> + <magentoCLI command="config:set paypal/general/merchant_country US" stepKey="setMerchantCountry"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <magentoCLI command="config:set paypal/general/merchant_country 0" stepKey="setMerchantCountryAsUS"/> + <magentoCLI command="config:set payment/payflow_advanced/active 0" stepKey="disablePaymentsAdvanced"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + </after> + <!--Admin navigate to payment configuration page and assert no other paypal payment is enabled--> + <actionGroup ref="AdminAssertPaypalAllInOnePaymentMethodActionGroup" stepKey="configPaymentsAdvanced"/> + <!--Clear paypal credit config related data--> + <actionGroup ref="AdminClearPaymentAdvancedDataActionGroup" stepKey="clearPaymentsAdvanced"/> + <!--Enable Payment Advanced and Paypal Credit--> + <actionGroup ref="AdminEnablePaymentAdvancedConfigurationActionGroup" stepKey="enablePaymentsAdvanced"/> + <!--Save Configuration--> + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfigs"/> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <!--Login to storefront as guest customer--> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> + <waitForPageLoad stepKey="waitForProductPage"/> + <!--Add simple product--> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart"> + <argument name="product" value="$simpleProduct$"/> + </actionGroup> + <!--Go to cart page--> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="gotoCart"/> + <!--Open cart page and proceed to checkout--> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckoutCartPage"/> + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/> + <!--Fill Shipping Address--> + <actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillShippingAddress"> + <argument name="customer" value="$$createCustomer$$" /> + <argument name="address" value="US_Address_TX"/> + </actionGroup> + <!-- Select shipping --> + <actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectShippingMethodAsFlatRate"> + <argument name="shippingMethodName" value="Flat Rate"/> + </actionGroup> + <!-- Go to Order review --> + <actionGroup ref="StorefrontCheckoutClickNextOnShippingStepActionGroup" stepKey="goToCheckoutPaymentPage"/> + <waitForPageLoad stepKey="waitForLoadingMask"/> + <!-- Assert Paypal Advanced and Paypal Credit Payment method --> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.payFlowEdition}}" stepKey="assertPayflowEdition"/> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.payFlowExpress}}" stepKey="assertPayflowExpress"/> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.creditCardPayflowAdvanced}}" stepKey="assertCreditCardPayflowAdvanced"/> + <magentoCLI command="config:set payment/payflow_advanced/active 0" stepKey="disablePaymentAdvanced"/> + <magentoCLI command="config:set payment/payflow_express_bml/active 0" stepKey="disablePaypalCredit"/> + <magentoCLI command="config:set payment/payflow_express/active 0" stepKey="disableExpressCheckout"/> + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPageAfterDisablingPayPalExpressCheckout"/> + <waitForPageLoad stepKey="waitForPaymentMethodPageToLoad"/> + <waitForElementClickable selector="{{AdminConfigPaymentsAdvancedSection.paymentsAdvanced('us')}}" stepKey="waitForClickPayPalConfigureBtnToAssertStatus"/> + <click selector="{{AdminConfigPaymentsAdvancedSection.paymentsAdvanced('us')}}" stepKey="clickPayPalConfigureBtnToAssertStatus"/> + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.greenCheckMrk('us')}}" stepKey="assertGreenTickMarkAbsentForEnableThisSolutionDropdown"/> + <assertElementContainsAttribute stepKey="seePaypalCreditIsDisabled"> + <expectedResult selector="{{AdminConfigPaymentsAdvancedSection.enablePaypalCredit('us')}}" attribute="disabled" type="string"></expectedResult> + </assertElementContainsAttribute> + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.disabledPaypalCredit('us')}}" stepKey="assertGreenTickMarkAbsentForEnablePaypalCreditDropdown"/> + <seeOptionIsSelected selector="{{AdminConfigPaymentsAdvancedSection.enablePaypalCredit('us')}}" userInput="No" stepKey="seePaypalCreditIsSetAsNo"/> + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.sortOrder('us')}}" stepKey="assertSortOrderFieldIsDisappeared"/> + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfiguration"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache1"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <waitForElementNotVisible selector="{{AdminPayPalPayFlowLinkConfigSection.closeButton('us')}}" stepKey="assertConfigureBtnIsDisabled"/> + <actionGroup ref="StorefrontNavigateToGuestCheckoutReviewAndPaymentsPageActionGroup" stepKey="goToStoreFrontCheckoutPageToAssertPaypalPaymentMethodIsDisappeared"/> + <!-- Assert Again Paypal Advanced and Paypal Credit Payment method --> + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.payFlowEdition}}" stepKey="assertPayflowEditionNptTobeDisplayed"/> + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.payFlowExpress}}" stepKey="assertPayPalCreditNotTobeDisplayed"/> + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.creditCardPayflowAdvanced}}" stepKey="assertCreditCardPayflowAdvancedNotToBeDisplayed"/> + <actionGroup ref="AdminConfigPaymentAdvancedThroughCLIActionGroup" stepKey="configurePaymentAdvancedAndPayFlowEdition"/> + <magentoCLI command="config:set payment/payflow_express_bml/active 0" stepKey="disableAgainPaypalCredit"/> + <amOnPage url="{{AdminConfigPaymentMethodsPage.url}}" stepKey="navigateToPaymentConfigurationPageAfterDisablingPayPalExpressCheckoutAgain"/> + <waitForPageLoad stepKey="waitForPaymentPageToLoad"/> + <waitForElementClickable selector="{{AdminConfigPaymentsAdvancedSection.paymentsAdvanced('us')}}" stepKey="waitForClickPayPalConfigureBtnToAssertStatus1"/> + <click selector="{{AdminConfigPaymentsAdvancedSection.paymentsAdvanced('us')}}" stepKey="clickPayPalConfigureBtnToAssertStatus1"/> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.greenCheckMrk('us')}}" stepKey="assertAgainGreenTickMarkPresentEnableThisSolutionDropdown1"/> + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.disabledPaypalCredit('us')}}" stepKey="assertGreenTickMarkAbsentForEnablePaypalCreditDropdown1"/> + <seeOptionIsSelected selector="{{AdminConfigPaymentsAdvancedSection.enablePaypalCredit('us')}}" userInput="No" stepKey="seePaypalCreditIsSetAsNo1"/> + <actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfiguration1"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache2"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <waitForElementNotVisible selector="{{AdminConfigPaymentsAdvancedSection.closeButton('us')}}" stepKey="assertConfigBtnIsDisabled"/> + <!--Go to checkout page and assert paypal express checkout option is present--> + <actionGroup ref="StorefrontNavigateToGuestCheckoutReviewAndPaymentsPageActionGroup" stepKey= "goToStoreFrontCheckoutPageToAssertPaypalPaymentMethodsPresent"/> + <waitForElementVisible selector="{{AdminConfigPaymentsAdvancedSection.creditCardPayflowAdvanced}}" stepKey="assertCreditCardPayflowAdvancedInStorefront"/> + <waitForElementVisible selector="{{StorefrontCheckoutPaymentMethodSection.checkPaymentMethodByName('PayPal Express Checkout Payflow Edition')}}" stepKey="assertPayPalExpressCheckoutPayflowEdition2"/> + </test> +</tests> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsAdvancedTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsAdvancedTest.xml new file mode 100644 index 0000000000000..94f2fcabfd965 --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminConfigPaymentsAdvancedTest.xml @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminConfigPaymentsAdvancedTest"> + <annotations> + <features value="PayPal"/> + <stories value="Payment methods"/> + <title value="Configuration apply to Paypal Pay later message on Cart Page for Payment Advanced"/> + <description value="Paypal Pay Later Message for Paypal Advanced should display on Admin Cart Page configuration"/> + <severity value="CRITICAL"/> + <testCaseId value="AC-5700"/> + <group value="3rd_party_integration"/> + <group value="pr_exclude" /> + </annotations> + <before> + <!-- US Customer is created --> + <createData entity="Simple_US_Customer_CA" stepKey="createCustomer"/> + <createData entity="SimpleProduct3" stepKey="simpleProduct"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminConfigPaymentsAdvancedActionGroup" stepKey="ConfigPaymentsAdvanced"/> + </before> + <after> + <deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/> + <magentoCLI command="config:set payment/payflow_advanced/active 0" stepKey="disablePaymentsAdvanced"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <waitForElementClickable selector="{{PaymentsAdvancedConfigSection.cartBtn('us')}}" stepKey="waitForCheckoutCartPageToBeClickable"/> + <click selector ="{{PaymentsAdvancedConfigSection.cartBtn('us')}}" stepKey="clickOnCart"/> + <selectOption selector ="{{PaymentsAdvancedConfigSection.payLaterDisplay('us')}}" userInput="Yes" stepKey="enableDisplay"/> + <click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfig"/> + <!-- Reindex and cache flush --> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> + <argument name="tags" value=""/> + </actionGroup> + <!-- Login to StoreFront --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <!--Add simple product--> + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="addSimpleProductToCart" > + <argument name="product" value="$simpleProduct$"/> + </actionGroup> + <!--Go to cart page--> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="gotoCart"/> + <waitForPageLoad stepKey="waitForShoppingCartPage"/> + <scrollToTopOfPage stepKey="scrollToTop"/> + <!--Switching to iFrame--> + <switchToIFrame selector="{{PaymentsAdvancedConfigSection.payPalFrame}}" stepKey="switchToPaypalIFrame"/> + <waitForElementVisible selector="{{PaymentsAdvancedConfigSection.payLaterMessage}}" stepKey="verifyPayLaterMessage"/> + <switchToIFrame stepKey="switchBackMainIframe"/> + <!--Change The Option in Position In Checkout cart Page--> + <actionGroup ref="AdminConfigPaymentsAdvancedActionGroup" stepKey="ConfigPaymentsAdvanced"> + </actionGroup> + <waitForElementClickable selector="{{PaymentsAdvancedConfigSection.cartBtn('us')}}" stepKey="waitForAdminCarttPageTobeClickable"/> + <click selector ="{{PaymentsAdvancedConfigSection.cartBtn('us')}}" stepKey="expandAdminCartePage"/> + <selectOption selector ="{{PaymentsAdvancedConfigSection.displayOption('us')}}" userInput="Yes" stepKey="enableCartPageDisplay"/> + <selectOption selector ="{{PaymentsAdvancedConfigSection.positionOption('us')}}" userInput="Under PayPal Checkout buttons" stepKey="updatedPositionValue"/> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexPage"> + <argument name="indices" value=""/> + </actionGroup> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCachePage"> + <argument name="tags" value=""/> + </actionGroup> + <!-- Navigate Again to Storefront --> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToCustomerStoreFront"/> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="onPageShoppingCart"/> + <scrollTo selector="{{PaymentsAdvancedConfigSection.payPalCheckoutField}}" stepKey="scrollToPaypalCheckout"/> + <waitForPageLoad stepKey="waitForCartpageTobeLoaded"/> + <switchToIFrame selector="{{PaymentsAdvancedConfigSection.payPalFrame}}" stepKey="switchToBuyNowPayLaterIFrame"/> + <seeElement selector="{{PaymentsAdvancedConfigSection.payLaterMessage}}" stepKey="verifyBuyNowPayLaterMessage"/> + <switchToIFrame stepKey="switchBackToMainPaypalFrame"/> + </test> +</tests> diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontApplyGiftsCardsAndCouponCodesInWidgetIsShownOnOrderReviewPageForPayflowLinkTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontApplyGiftsCardsAndCouponCodesInWidgetIsShownOnOrderReviewPageForPayflowLinkTest.xml new file mode 100644 index 0000000000000..017e16dc8288e --- /dev/null +++ b/app/code/Magento/Paypal/Test/Mftf/Test/StorefrontApplyGiftsCardsAndCouponCodesInWidgetIsShownOnOrderReviewPageForPayflowLinkTest.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontApplyGiftsCardsAndCouponCodesInWidgetIsShownOnOrderReviewPageForPayflowLinkTest"> + <annotations> + <features value="Payments"/> + <stories value="Payflow link"/> + <title value="Apply gift cards or promo codes widget is shown on Order review page for Payflow link"/> + <description value="As a guest, apply coupon and gift card while placing an order through paypal payflow link"/> + <severity value="MAJOR"/> + <testCaseId value="AC-4378"/> + <group value="3rd_party_integration"/> + <group value="pr_exclude"/> + </annotations> + <before> + <actionGroup ref="AdminEnablePayPalPayFlowLinkActionGroup" stepKey="ConfigPayPalPayFlowLink" after="createCartPriceRule"> + <argument name="credentials" value="SamplePaypalPaymentsFlowLinkConfig"/> + </actionGroup> + </before> + <after> + <actionGroup ref="AdminDisablePayPalPayFlowLinkActionGroup" stepKey="disablePayPalPayFlow" after="deleteCustomer"/> + </after> + <!--Login to Paypal in-context--> + <actionGroup ref="StorefrontLoginToPayPalPaymentAccountTwoStepActionGroup" stepKey="LoginToPayPal" after="clickPayPalBtn"/> + <actionGroup ref="StorefrontSelectShippingMethodOnOrderReviewPageActionGroup" stepKey="selectShippingMethod" after="waitForPageLoad"/> + <waitForElementClickable selector="{{StorefrontPayPalOrderReviewSection.applyDiscountCodeHeader}}" stepKey="waitForDiscountHeaderToBeClickable" after="selectShippingMethod"/> + <click selector="{{StorefrontPayPalOrderReviewSection.applyDiscountCodeHeader}}" stepKey="clickDiscountHeader" after="waitForDiscountHeaderToBeClickable"/> + <waitForElementVisible selector="{{StorefrontPayPalOrderReviewSection.discountCodeField}}" stepKey="waitForDiscountCodeFieldToBeVisible" after="clickDiscountHeader"/> + <fillField selector="{{StorefrontPayPalOrderReviewSection.discountCodeField}}" userInput="{{CatPriceRule.coupon_code}}" stepKey="fillDiscountCodeField" after="waitForDiscountCodeFieldToBeVisible"/> + <waitForElementClickable selector="{{StorefrontPayPalOrderReviewSection.applyDiscount}}" stepKey="waitForApplyDiscountToBeClickable" after="fillDiscountCodeField"/> + <click selector="{{StorefrontPayPalOrderReviewSection.applyDiscount}}" stepKey="clickApplyDiscount" after="waitForApplyDiscountToBeClickable"/> + <waitForPageLoad stepKey="waitForCouponToBeApplied" after="clickApplyDiscount"/> + <waitForElement selector="{{StorefrontPayPalOrderReviewSection.grandTotal('$95.00')}}" stepKey="assertTotalAfterDiscountApplied" after="waitForCouponToBeApplied"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoiceMainActionsSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoiceMainActionsSection.xml index 4319fb04da6e1..6da395c173092 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoiceMainActionsSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoiceMainActionsSection.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. + * Copyright 2024 Adobe + * All Rights Reserved. */ --> @@ -12,5 +12,6 @@ <element name="submitInvoice" type="button" selector=".action-default.scalable.save.submit-button.primary" timeout="60"/> <element name="openNewCreditMemoFromInvoice" type="button" selector=".action-default.scalable.credit-memo"/> <element name="submitNewRefundFromInvoice" type="button" selector=".action-default.scalable.save.submit-button.refund.primary"/> + <element name="selectModeOfAmount" type="select" selector=".admin__control-select"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml index dd8544de2ee98..bd92fe38fb216 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. + * Copyright 2024 Adobe + * All Rights Reserved. */ --> @@ -30,5 +30,6 @@ <element name="ok" type="button" selector=".//*[@data-role='action']"/> <element name="void" type="button" selector="#void_payment span"/> <element name="invoiceTabContent1" type="text" selector="#sales_order_view_tabs_order_invoices_content > div > div.admin__data-grid-wrap > table > tbody > tr > td"/> + <element name="creditMemoWarning" type="text" selector="//div[@class='modal-content']//div[text()='This will create an offline refund. To create an online refund, open an invoice and create credit memo for it. Do you want to continue?']"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml index 88ba2bbec09c8..2f966f2597f1a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormPaymentSection.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. + * Copyright 2024 Adobe + * All Rights Reserved. */ --> @@ -34,5 +34,6 @@ <element name="storedCard" type="radio" selector="#p_method_payflowpro_cc_vault" timeout="30"/> <element name="selectPaymentMethod" type="radio" selector="//div[@id='order-billing_method_form']//input[@title='Check / Money order']"/> <element name="checkMoneyOrderText" type="text" selector="//div[@id='order-billing_method_form']//dl//dt//label[contains(text(),'Check / Money order')]"/> + <element name="upsOption" type="radio" selector="//label[contains(text(),'UPS Worldwide Expedited -')]//ancestor::label[@class='admin__field-label']"/> </section> </sections> diff --git a/app/code/Magento/Shipping/Test/Mftf/Test/AdminPlaceOrderUsingUPSOnlineShippingCarrierForRegisteredCustomerTest.xml b/app/code/Magento/Shipping/Test/Mftf/Test/AdminPlaceOrderUsingUPSOnlineShippingCarrierForRegisteredCustomerTest.xml new file mode 100644 index 0000000000000..68c0efe291f60 --- /dev/null +++ b/app/code/Magento/Shipping/Test/Mftf/Test/AdminPlaceOrderUsingUPSOnlineShippingCarrierForRegisteredCustomerTest.xml @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminPlaceOrderUsingUPSOnlineShippingCarrierForRegisteredCustomerTest"> + <annotations> + <stories value="Place order using UPS Shipping carrier"/> + <title value="Use UPS online shipping carrier during order placement in admin for registered customer Test"/> + <description value="Select UPS online shipping method while order placement from backend for a registered customer"/> + <testCaseId value="AC-4884"/> + <severity value="MAJOR"/> + <features value="Shipping"/> + <group value="3rd_party_integration"/> + <group value="pr_exclude"/> + </annotations> + <before> + <!--Login as Admin--> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdminToConfig"/> + <!-- Create product --> + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> + <field key="price">100.00</field> + </createData> + <!--Create UK customer--> + <createData entity="UKCustomer" stepKey="createUKCustomer"/> + <!-- Enabling Check/Money Order Payment Method --> + <magentoCLI command="config:set {{EnableCheckMoneyOrderPaymentMethod.path}} {{EnableCheckMoneyOrderPaymentMethod.value}}" stepKey="enableCheckMoneyOrderPaymentMethod"/> + <!--Set Shipping settings origin data--> + <actionGroup ref="AdminSetShippingOriginConfigActionGroup" stepKey="setShippingOriginConfigurationData"> + <argument name="country" value="United States"/> + <argument name="state" value="California"/> + <argument name="postcode" value="90034"/> + </actionGroup> + <!--Navigate to shipping method configuration for enabling UPS--> + <actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPageForEnablingUPS"/> + <!--Configure UPS shipping method with enable for checkout = Yes--> + <actionGroup ref="AdminEnableUPSActionGroup" stepKey="enableUPSShippingMethod"> + <argument name="shipping" value="UPSShippingMethod"/> + </actionGroup> + <!--Cache flush--> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCachePostConfiguring"> + <argument name="tags" value="config full_page"/> + </actionGroup> + </before> + <after> + <!--Reset Shipping Origin configurations to default | default address - US California--> + <actionGroup ref="AdminResetShippingOriginConfigurationActionGroup" stepKey="resetShippingOriginConfig"/> + <!--delete UK customer--> + <deleteData createDataKey="createUKCustomer" stepKey="deleteCustomer"/> + <!--delete product--> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> + <!--Configure UPS shipping method with enable for checkout = No--> + <actionGroup ref="AdminUPSDisableActionGroup" stepKey="disableUPSShippingMethod"/> + <!--Logout Admin--> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdminToRollBackConfig"/> + </after> + <!--Navigate to create new order with existing customer--> + <actionGroup ref="AdminNavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> + <argument name="customer" value="$$createUKCustomer$$"/> + </actionGroup> + <!--Admin add simple product to order--> + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> + <argument name="product" value="$$createSimpleProduct$$"/> + </actionGroup> + <!--Admin add new UK billing address while creating order--> + <selectOption userInput="Add New Address" selector="{{AdminOrderFormBillingAddressSection.selectAddress}}" stepKey="addNewBillingAddress" /> + <actionGroup ref="AdminFillAddressInformationInOrderActionGroup" stepKey="FillOrderNewShippingAddress"> + <argument name="customer" value="$$createUKCustomer$$"/> + <argument name="address" value="UK_Not_Default_Address"/> + </actionGroup> + <!--Scroll to element & click to reflect details as per defined address & customer--> + <scrollTo selector="{{AdminOrderFormBillingAddressSection.Phone}}" stepKey="scrollToElementInteractable"/> + <click selector="{{AdminOrderFormPaymentSection.linkPaymentOptions}}" stepKey="clickToReflectDetailsAccordingToInputData"/> + <!--Checkout select Check/Money Order payment--> + <actionGroup ref="SelectCheckMoneyPaymentMethodActionGroup" stepKey="selectCheckMoneyPayment"/> + <!--click on get shipping methods link--> + <click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="unfocus"/> + <waitForLoadingMaskToDisappear stepKey="waitForJavascriptToFinish"/> + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShippingMethods"/> + <waitForElementVisible selector="{{AdminOrderFormPaymentSection.upsOption}}" stepKey="waitForShippingOptions"/> + <click selector="{{AdminOrderFormPaymentSection.upsOption}}" stepKey="selectUPSMethod"/> + <waitForAjaxLoad stepKey="waitForAjaxLoadPostSelectingUPSShippingMethod"/> + <!--Submit Order and verify information--> + <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> + <!--Assert order created--> + <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="checkOrderSuccessfullyCreated"/> + </test> +</tests> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateCMSPageLinkWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateCMSPageLinkWidgetActionGroup.xml new file mode 100644 index 0000000000000..cd9139312c948 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateCMSPageLinkWidgetActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCreateCMSPageLinkWidgetActionGroup" extends="AdminCreateWidgetActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateWidgetActionGroup. Creates a CMS Page link widget.</description> + </annotations> + <waitForElementClickable selector="{{AdminNewWidgetSection.selectPage}}" stepKey="waitForSelectPageButtonToBeClickable"/> + <click selector="{{AdminNewWidgetSection.selectPage}}" stepKey="clickSelectPage"/> + <waitForPageLoad stepKey="WaitForPageLoad"/> + <waitForElementClickable selector="{{AdminNewWidgetSection.enableCookies}}" stepKey="waitForEnableCookiesToBeClickable"/> + <click selector="{{AdminNewWidgetSection.enableCookies}}" stepKey="clickenableCookies"/> + <waitForPageLoad stepKey="WaitForPageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateCatalogProductsListWidgetWithTwoConditionsActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateCatalogProductsListWidgetWithTwoConditionsActionGroup.xml new file mode 100644 index 0000000000000..72b35a227d2e4 --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateCatalogProductsListWidgetWithTwoConditionsActionGroup.xml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCreateCatalogProductsListWidgetWithTwoConditionsActionGroup" extends="AdminCreateWidgetActionGroup"> + <annotations> + <description>EXTENDS: AdminCreateWidgetActionGroup. Creates a Product List Widget with two conditions.</description> + </annotations> + <arguments> + <argument name="title" defaultValue="" type="string"/> + <argument name="displayPageControl" defaultValue="0" type="string"/> + <argument name="numberOfProductsToDisplay" defaultValue="10" type="string"/> + <argument name="cacheLifetime" defaultValue="" type="string"/> + <argument name="condition" defaultValue="SKU" type="string"/> + <argument name="conditionsOperator" defaultValue="is one of" type="string"/> + <argument name="conditionParameter" defaultValue="" type="string"/> + <argument name="secondCondition" defaultValue="Price" type="string"/> + <argument name="secondConditionOperator" defaultValue="equals or less than" type="string"/> + <argument name="secondConditionParameter" defaultValue="10" type="string"/> + </arguments> + <waitForElementVisible selector="{{AdminNewWidgetSection.title}}" stepKey="waitForTitleFieldToBeVisible"/> + <fillField selector="{{AdminNewWidgetSection.title}}" userInput="{{title}}" stepKey="fillTitleWidgetOption"/> + <selectOption selector="{{AdminNewWidgetSection.displayPageControl}}" userInput="{{displayPageControl}}" stepKey="selectDisplayPageControl"/> + <waitForElementVisible selector="{{AdminNewWidgetSection.numberOfProductsToDisplay}}" stepKey="waitForNumberOfProductsToDisplayFieldToBeVisible"/> + <fillField selector="{{AdminNewWidgetSection.numberOfProductsToDisplay}}" userInput="{{numberOfProductsToDisplay}}" stepKey="fillNumberOfProductsToDisplay"/> + <waitForElementVisible selector="{{AdminNewWidgetSection.cacheLifetime}}" stepKey="waitForCacheLifeTimeFieldToBeVisible"/> + <fillField selector="{{AdminNewWidgetSection.cacheLifetime}}" userInput="{{cacheLifetime}}" stepKey="fillCacheLifetime"/> + <waitForElementClickable selector="{{AdminNewWidgetSection.addNewCondition}}" stepKey="waitForAddNewConiditionToBeClickable"/> + <click selector="{{AdminNewWidgetSection.addNewCondition}}" stepKey="clickAddNewCondition"/> + <selectOption selector="{{AdminNewWidgetSection.selectCondition}}" userInput="{{condition}}" stepKey="selectCondition"/> + <waitForElementClickable selector="{{AdminNewWidgetSection.conditionOperator}}" stepKey="clickConditionsOperator234"/> + <click selector="{{AdminNewWidgetSection.conditionOperator}}" stepKey="clickConditionsOperator"/> + <selectOption selector="{{AdminNewWidgetSection.selectOperator}}" userInput="{{conditionsOperator}}" stepKey="selectConditionsOperator"/> + <waitForElementClickable selector="{{AdminNewWidgetSection.ruleParameter}}" stepKey="waitForConiditionParameterToBeClickable"/> + <click selector="{{AdminNewWidgetSection.ruleParameter}}" stepKey="clickConditionParameter"/> + <waitForElementVisible selector="{{AdminNewWidgetSection.setRuleParameter}}" stepKey="waitForConditionParameterFieldToBeVisible"/> + <fillField selector="{{AdminNewWidgetSection.setRuleParameter}}" userInput="{{conditionParameter}}" stepKey="fillConditionParameter"/> + <waitForElementClickable selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="waitForApplyConditionToBeClickable"/> + <click selector="{{AdminNewWidgetSection.applyParameter}}" stepKey="clickApplyCondition"/> + <waitForElementClickable selector="{{AdminNewWidgetSection.addNewCondition}}" stepKey="waitForAddNewButtonToBeClickableForSecondCondition"/> + <click selector="{{AdminNewWidgetSection.addNewCondition}}" stepKey="clickAddNewForSecondCondition"/> + <selectOption selector="{{AdminNewWidgetSection.selectCondition}}" userInput="{{secondCondition}}" stepKey="selectSecondCondition"/> + <waitForPageLoad stepKey="waitForConditionsOperator"/> + <waitForElementClickable selector="{{AdminNewWidgetSection.secondConditionOperator}}" stepKey="waitForSecondConditionsOperatorToBeClickable"/> + <click selector="{{AdminNewWidgetSection.secondConditionOperator}}" stepKey="clickSecondConditionsOperator"/> + <selectOption selector="{{AdminNewWidgetSection.secondSelectOperator}}" userInput="{{secondConditionOperator}}" stepKey="selectSecondConditionsOperator"/> + <waitForElementClickable selector="{{AdminNewWidgetSection.secondRuleParameter}}" stepKey="waitForSecondRuleParameterToBeClickable"/> + <click selector="{{AdminNewWidgetSection.secondRuleParameter}}" stepKey="clickSecondRuleParameter"/> + <waitForElementVisible selector="{{AdminNewWidgetSection.setSecondRuleParameter}}" stepKey="waitForSecondConditionParameterToBeVisible"/> + <fillField selector="{{AdminNewWidgetSection.setSecondRuleParameter}}" userInput="{{secondConditionParameter}}" stepKey="fillSecondConditionParameter"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml b/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml index 2702c9a9e19a8..393414156a3b4 100644 --- a/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml +++ b/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. + * Copyright 2024 Adobe + * All Rights Reserved. */ --> @@ -69,4 +69,16 @@ <data key="display_on">All Pages</data> <data key="container">Main Content Area</data> </entity> + <entity name="CmsPageLinkWidget" type="widget"> + <data key="type">CMS Page Link</data> + <data key="design_theme">Magento Luma</data> + <data key="name" unique="suffix">TestWidget</data> + <data key="sort_order">0</data> + <array key="store_ids"> + <item>All Store Views</item> + </array> + <data key="display_on">All Pages</data> + <data key="container">Main Content Area</data> + <data key="template">CMS Page Link Block template</data> + </entity> </entities> diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml index dc5a11041c99d..30d0f3518b1d3 100644 --- a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml +++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. + * Copyright 2024 Adobe + * All Rights Reserved. */ --> @@ -60,6 +60,12 @@ <element name="cacheLifetime" type="input" selector="[name='parameters[cache_lifetime]']"/> <element name="deleteWidgetLayoutAction" type="button" selector="#page_group_container > div:first-of-type > div.fieldset-wrapper-title > div > .action-default.action-delete"/> <element name="CountDeleteButtons" type="button" selector="#page_group_container > .fieldset-wrapper.page_group_container > div.fieldset-wrapper-title > div > .action-default.action-delete"/> + <element name="secondConditionOperator" type="button" selector="//input[@id='conditions__1--2__type']/following::a[@class='label'][1]"/> + <element name="secondSelectOperator" type="button" selector="//input[@id='conditions__1--2__type']/following::a[@class='label'][1]/..//span//select"/> + <element name="secondRuleParameter" type="select" selector="//input[@id='conditions__1--2__type']/following::a[@class='label'][2]"/> + <element name="setSecondRuleParameter" type="input" selector="#conditions__1--2__value"/> + <element name="selectPage" type="button" selector="//span[contains(text(),'Select Page')]"/> + <element name="enableCookies" type="button" selector="//tbody//tr//td[contains(text(),'Enable Cookies')]"/> </section> </sections> diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminAddTwoPlusWidgetsInOneContainerTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminAddTwoPlusWidgetsInOneContainerTest.xml new file mode 100644 index 0000000000000..be0ce50973a9b --- /dev/null +++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminAddTwoPlusWidgetsInOneContainerTest.xml @@ -0,0 +1,80 @@ +<!-- +/** + * Copyright 2024 Adobe + * All Rights Reserved. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminAddTwoPlusWidgetsInOneContainerTest"> + <annotations> + <features value="Widget"/> + <stories value="content widgets"/> + <title value="Add multiple widgets in one container"/> + <description value="Test for adding multiple widgets in a single container and verifying the functionality on the storefront"/> + <severity value="MAJOR"/> + <testCaseId value="AC-4400"/> + </annotations> + <before> + <!-- 1. Create multiple products and assign to a category. --> + <createData entity="ApiCategory" stepKey="createCategory"/> + <createData entity="ApiSimpleProduct" stepKey="createFirstSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + <field key="price">9</field> + </createData> + <createData entity="ApiSimpleProduct" stepKey="createSecondSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + <field key="price">1</field> + </createData> + <createData entity="ApiSimpleProduct" stepKey="createThirdSimpleProduct"> + <requiredEntity createDataKey="createCategory"/> + <field key="price">10</field> + </createData> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <actionGroup ref="AdminCreateCatalogProductsListWidgetWithTwoConditionsActionGroup" stepKey="createProductListWidget"> + <argument name="widget" value="CatalogProductsListWidget"/> + <argument name="title" value="Some Title"/> + <argument name="displayPageControl" value="1"/> + <argument name="numberOfProductsToDisplay" value="10"/> + <argument name="condition" value="SKU"/> + <argument name="conditionsOperator" value="is one of"/> + <argument name="conditionParameter" value="$createFirstSimpleProduct.sku$,$createSecondSimpleProduct.sku$"/> + </actionGroup> + <actionGroup ref="AdminSaveAndContinueWidgetActionGroup" stepKey="saveWidgetAndContinue"/> + <actionGroup ref="AdminCreateCMSPageLinkWidgetActionGroup" stepKey="createCMSPageWidget"> + <argument name="widget" value="CmsPageLinkWidget"/> + </actionGroup> + <actionGroup ref="AdminSaveAndContinueWidgetActionGroup" stepKey="saveCMSWidget"/> + <actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> + <argument name="indices" value=""/> + </actionGroup> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache"> + <argument name="tags" value=""/> + </actionGroup> + </before> + <after> + <!--Delete widget catalog product list--> + <actionGroup ref="AdminDeleteWidgetActionGroup" stepKey="deleteWidgetCatalogProductList"> + <argument name="widget" value="CatalogProductsListWidget"/> + </actionGroup> + <actionGroup ref="AdminDeleteWidgetActionGroup" stepKey="deleteWidgetCMSPageLink"> + <argument name="widget" value="CmsPageLinkWidget"/> + </actionGroup> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <!--Delete first simple product--> + <deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteFirstSimpleProduct"/> + <!--Delete second simple product--> + <deleteData createDataKey="createSecondSimpleProduct" stepKey="deleteSecondSimpleProduct"/> + <!--Delete third simple product--> + <deleteData createDataKey="createThirdSimpleProduct" stepKey="deleteThirdSimpleProduct"/> + <!--Logout from Admin--> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStoreFront"/> + <waitForElementVisible selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createFirstSimpleProduct.name$$)}}" stepKey="assertFirstSimpleProduct"/> + <waitForElementVisible selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSecondSimpleProduct.name$$)}}" stepKey="assertSecondSimpleProduct"/> + <waitForElementNotVisible selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createThirdSimpleProduct.name$$)}}" stepKey="assertSecondSimpleProductIsNotAvaiable"/> + <waitForElement selector="{{StorefrontCategoryMainSection.enableCookies}}" stepKey="assertCookiesLinkIsAvailable"/> + </test> +</tests>