From e1a8c681b7f41f51797d07bdf9e1d67e3194707b Mon Sep 17 00:00:00 2001 From: Dmitry Tsymbal Date: Thu, 15 Apr 2021 14:47:34 +0300 Subject: [PATCH 01/35] Unlock Admin User Entity Test --- ...inFindUserOnLockedUsersGridActionGroup.xml | 21 +++++ ...UnlockAdminUserEntityOnGridActionGroup.xml | 19 +++++ .../Section/AdminLockedUsersGridSection.xml | 18 +++++ .../Test/AdminUnlockAdminUserEntityTest.xml | 78 +++++++++++++++++++ 4 files changed, 136 insertions(+) create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminFindUserOnLockedUsersGridActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/ActionGroup/AdminUnlockAdminUserEntityOnGridActionGroup.xml create mode 100644 app/code/Magento/User/Test/Mftf/Section/AdminLockedUsersGridSection.xml create mode 100644 app/code/Magento/User/Test/Mftf/Test/AdminUnlockAdminUserEntityTest.xml diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminFindUserOnLockedUsersGridActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminFindUserOnLockedUsersGridActionGroup.xml new file mode 100644 index 0000000000000..7cdbc71b38f8e --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminFindUserOnLockedUsersGridActionGroup.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + diff --git a/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUnlockAdminUserEntityOnGridActionGroup.xml b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUnlockAdminUserEntityOnGridActionGroup.xml new file mode 100644 index 0000000000000..e23cc0b2a7308 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/ActionGroup/AdminUnlockAdminUserEntityOnGridActionGroup.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + diff --git a/app/code/Magento/User/Test/Mftf/Section/AdminLockedUsersGridSection.xml b/app/code/Magento/User/Test/Mftf/Section/AdminLockedUsersGridSection.xml new file mode 100644 index 0000000000000..6eae8740765f9 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/Section/AdminLockedUsersGridSection.xml @@ -0,0 +1,18 @@ + + + +
+ + + + + + +
+
diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminUnlockAdminUserEntityTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminUnlockAdminUserEntityTest.xml new file mode 100644 index 0000000000000..2f8bf959b5c49 --- /dev/null +++ b/app/code/Magento/User/Test/Mftf/Test/AdminUnlockAdminUserEntityTest.xml @@ -0,0 +1,78 @@ + + + + + + + + + + <description value="Unlocked user should be able login into admin panel"/> + <severity value="MAJOR"/> + <group value="user"/> + </annotations> + <before> + <magentoCLI command="config:set admin/captcha/enable 0" stepKey="disableAdminCaptcha"/> + <magentoCLI command="config:set admin/security/lockout_failures 2" stepKey="setDefaultMaximumLoginFailures"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/> + </before> + <after> + <magentoCLI command="config:set admin/captcha/enable 1" stepKey="enableAdminCaptcha"/> + <magentoCLI command="config:set admin/security/lockout_failures 6" stepKey="setDefaultMaximumLoginFailures"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCachesAfterTestExecution"> + <argument name="tags" value="config full_page"/> + </actionGroup> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdmin"/> + <actionGroup ref="AdminDeleteCustomUserActionGroup" stepKey="deleteCreatedUser"> + <argument name="user" value="adminUserCorrectPassword"/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> + </after> + + <actionGroup ref="AdminOpenNewUserPageActionGroup" stepKey="goToNewUserPage"/> + <actionGroup ref="AdminFillNewUserFormRequiredFieldsActionGroup" stepKey="fillNewUserForm"> + <argument name="user" value="adminUserCorrectPassword"/> + </actionGroup> + <actionGroup ref="AdminClickSaveButtonOnUserFormActionGroup" stepKey="saveNewUser"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsDefaultUser"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsCreatedUserWithIncorrectCredentials"> + <argument name="username" value="{{adminUserIncorrectPassword.username}}"/> + <argument name="password" value="{{adminUserIncorrectPassword.password}}"/> + </actionGroup> + <actionGroup ref="AdminLoginActionGroup" stepKey="lockNewlyCreatedUser"> + <argument name="username" value="{{adminUserIncorrectPassword.username}}"/> + <argument name="password" value="{{adminUserIncorrectPassword.password}}"/> + </actionGroup> + <actionGroup ref="AssertMessageOnAdminLoginActionGroup" stepKey="assertErrorMessage"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsDefaultAdminUser"/> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToSystemLockedUsersPage"> + <argument name="menuUiId" value="{{AdminMenuSystem.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuSystemPermissionsLockedUsers.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminFindUserOnLockedUsersGridActionGroup" stepKey="findLockedUser"> + <argument name="user" value="adminUserCorrectPassword"/> + </actionGroup> + <actionGroup ref="AdminUnlockAdminUserEntityOnGridActionGroup" stepKey="unlockAdminUser"> + <argument name="option" value="Unlock"/> + </actionGroup> + <actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage"> + <argument name="message" value="Unlocked 1 user(s)."/> + </actionGroup> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsDefaultAdminUser"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsUnlockedUser"> + <argument name="username" value="{{adminUserCorrectPassword.username}}"/> + <argument name="password" value="{{adminUserCorrectPassword.password}}"/> + </actionGroup> + <actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="seeDashboardPage"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsUnlockedAdminUser"/> + </test> +</tests> From c9340ca609b44fe3774924b9138f6b632dc77c80 Mon Sep 17 00:00:00 2001 From: Dmitry Tsymbal <d.stymbal@atwix.com> Date: Wed, 23 Jun 2021 15:49:56 +0300 Subject: [PATCH 02/35] Disallow Guests To Write Product Reviews --- .../Catalog/Test/Mftf/Data/ConfigData.xml | 11 ++++- .../StorefrontProductReviewsSection.xml | 1 + ...AssertReviewFieldsAreAbsentActionGroup.xml | 17 +++++++ ...ficationForNotLoggedInUsersActionGroup.xml | 17 +++++++ ...ReviewDisallowGuestsToWriteReviewsTest.xml | 48 +++++++++++++++++++ 5 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Review/Test/Mftf/ActionGroup/StorefrontAssertReviewFieldsAreAbsentActionGroup.xml create mode 100644 app/code/Magento/Review/Test/Mftf/ActionGroup/StorefrontAssertReviewNotificationForNotLoggedInUsersActionGroup.xml create mode 100644 app/code/Magento/Review/Test/Mftf/Test/StorefrontReviewDisallowGuestsToWriteReviewsTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ConfigData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ConfigData.xml index 35c5c8ac3c866..73a73ca877b85 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ConfigData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ConfigData.xml @@ -16,4 +16,13 @@ <data key="path">catalog/layered_navigation/display_category</data> <data key="value">0</data> </entity> -</entities> \ No newline at end of file + <entity name="AllowGuestsToWriteReviewsConfigData"> + <!-- Magento Default Value --> + <data key="path">catalog/review/allow_guest</data> + <data key="value">1</data> + </entity> + <entity name="DisAllowGuestsToWriteReviewsConfigData"> + <data key="path">catalog/review/allow_guest</data> + <data key="value">0</data> + </entity> +</entities> diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductReviewsSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductReviewsSection.xml index 8b9b8ba289799..3757ba2f5e21d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductReviewsSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductReviewsSection.xml @@ -20,5 +20,6 @@ <element name="reviewAuthor" type="text" selector=".item.review-item:nth-of-type({{row}}) .review-author .review-details-value" parameterized="true"/> <!-- The tab transform to an accordion when window resize --> <element name="reviewsSectionToggleState" type="button" selector="//*[@id='tab-label-reviews-title']/ancestor::div[@aria-selected='{{boolean}}'][@aria-expanded='{{boolean}}']" parameterized="true"/> + <element name="infoForNotLoggedIn" type="block" selector=".block-content .message.info.notlogged"/> </section> </sections> diff --git a/app/code/Magento/Review/Test/Mftf/ActionGroup/StorefrontAssertReviewFieldsAreAbsentActionGroup.xml b/app/code/Magento/Review/Test/Mftf/ActionGroup/StorefrontAssertReviewFieldsAreAbsentActionGroup.xml new file mode 100644 index 0000000000000..75098e6e213fe --- /dev/null +++ b/app/code/Magento/Review/Test/Mftf/ActionGroup/StorefrontAssertReviewFieldsAreAbsentActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertReviewFieldsAreAbsentActionGroup"> + <dontSeeElement selector="{{StorefrontProductReviewsSection.nicknameField}}" stepKey="doNotSeeNicknameField"/> + <dontSeeElement selector="{{StorefrontProductReviewsSection.summaryField}}" stepKey="doNotSeeSummaryField"/> + <dontSeeElement selector="{{StorefrontProductReviewsSection.reviewField}}" stepKey="doNotSeeReviewField"/> + <dontSeeElement selector="{{StorefrontProductReviewsSection.submitReview}}" stepKey="doNotSeeSubmitButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Review/Test/Mftf/ActionGroup/StorefrontAssertReviewNotificationForNotLoggedInUsersActionGroup.xml b/app/code/Magento/Review/Test/Mftf/ActionGroup/StorefrontAssertReviewNotificationForNotLoggedInUsersActionGroup.xml new file mode 100644 index 0000000000000..65ed525cb7555 --- /dev/null +++ b/app/code/Magento/Review/Test/Mftf/ActionGroup/StorefrontAssertReviewNotificationForNotLoggedInUsersActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontAssertReviewNotificationForNotLoggedInUsersActionGroup"> + <arguments> + <argument name="message" type="string"/> + </arguments> + <see userInput="{{message}}" selector="{{StorefrontProductReviewsSection.infoForNotLoggedIn}}" stepKey="verifyMessage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Review/Test/Mftf/Test/StorefrontReviewDisallowGuestsToWriteReviewsTest.xml b/app/code/Magento/Review/Test/Mftf/Test/StorefrontReviewDisallowGuestsToWriteReviewsTest.xml new file mode 100644 index 0000000000000..7594b4f96c679 --- /dev/null +++ b/app/code/Magento/Review/Test/Mftf/Test/StorefrontReviewDisallowGuestsToWriteReviewsTest.xml @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontReviewDisallowGuestsToWriteReviewsTest"> + <annotations> + <features value="Review"/> + <stories value="Disallow guests to write reviews"/> + <title value="Guests are not allowed to write reviews if the option disabled in admin"/> + <description value="Guests should be not able write product reviews if the option disabled in configurations"/> + <severity value="MINOR"/> + <group value="catalog"/> + </annotations> + <before> + <magentoCLI command="config:set {{DisAllowGuestsToWriteReviewsConfigData.path}} {{DisAllowGuestsToWriteReviewsConfigData.value}}" stepKey="disAllowGuestsWriteReviews"/> + <createData entity="SimpleSubCategory" stepKey="createCategory"/> + <createData entity="_defaultProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + </before> + <after> + <magentoCLI command="config:set {{AllowGuestsToWriteReviewsConfigData.path}} {{AllowGuestsToWriteReviewsConfigData.value}}" stepKey="returnDefaultValue"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + </after> + + <actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory"> + <argument name="category" value="$createCategory$"/> + <argument name="product" value="$createProduct$"/> + </actionGroup> + <actionGroup ref="StorefrontAssertReviewNotificationForNotLoggedInUsersActionGroup" stepKey="assertMessage"> + <argument name="message" value="Only registered users can write reviews. Please Sign in or create an account"/> + </actionGroup> + <actionGroup ref="StorefrontAssertReviewFieldsAreAbsentActionGroup" stepKey="assertReviewElementsNotVisible"/> + </test> +</tests> From ed6bb0f51bf4b8c0f24014cf84ecc216447a659e Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Wed, 23 Jun 2021 17:01:31 +0300 Subject: [PATCH 03/35] created AssertStorefrontProductInfoMainProductNameActionGroup --- ...minDeleteBundleDynamicPriceProductTest.xml | 4 +++- .../AdminDeleteBundleDynamicProductTest.xml | 4 +++- .../AdminDeleteBundleFixedProductTest.xml | 4 +++- .../Test/AdminImportBundleProductTest.xml | 4 +++- ...tProductInfoMainProductNameActionGroup.xml | 20 +++++++++++++++++++ .../AdminAddInStockProductToTheCartTest.xml | 4 +++- ...eateCategoryWithProductsGridFilterTest.xml | 4 +++- ...mProductAttributeWithDropdownFieldTest.xml | 4 +++- ...ateProductAttributeFromProductPageTest.xml | 4 +++- ...tualProductOutOfStockWithTierPriceTest.xml | 4 +++- ...CustomOptionsSuiteAndImportOptionsTest.xml | 4 +++- ...teVirtualProductWithoutManageStockTest.xml | 4 +++- ...minDeleteConfigurableChildProductsTest.xml | 8 ++++++-- ...AdminDeleteProductWithCustomOptionTest.xml | 4 +++- .../Test/AdminDeleteSimpleProductTest.xml | 4 +++- .../Test/AdminDeleteVirtualProductTest.xml | 4 +++- ...eAnchoredCategoryToDefaultCategoryTest.xml | 8 ++++++-- ...CategoryFromParentAnchoredCategoryTest.xml | 8 ++++++-- .../AdminMoveProductBetweenCategoriesTest.xml | 4 +++- ...dminNavigateMultipleUpSellProductsTest.xml | 4 +++- .../AdminUpdateCategoryWithProductsTest.xml | 4 +++- ...inUpdateFlatCategoryAndAddProductsTest.xml | 8 ++++++-- ...WithRegularPriceInStockEnabledFlatTest.xml | 4 +++- ...rPriceInStockVisibleInCategoryOnlyTest.xml | 4 +++- ...thCustomOptionsVisibleInSearchOnlyTest.xml | 4 +++- ...tOfStockVisibleInCategoryAndSearchTest.xml | 4 +++- ...iceOutOfStockVisibleInCategoryOnlyTest.xml | 4 +++- ...PriceOutOfStockVisibleInSearchOnlyTest.xml | 4 +++- ...eInStockVisibleInCategoryAndSearchTest.xml | 4 +++- ...tOfStockVisibleInCategoryAndSearchTest.xml | 4 +++- ...rPriceInStockVisibleInCategoryOnlyTest.xml | 4 +++- ...tOfStockVisibleInCategoryAndSearchTest.xml | 4 +++- ...orefrontProductNameWithDoubleQuoteTest.xml | 4 +++- ...refrontProductNameWithHTMLEntitiesTest.xml | 4 +++- .../Test/AdminDeleteCatalogPriceRuleTest.xml | 16 +++++++++++---- ...AdminConfigurableProductBulkDeleteTest.xml | 12 ++++++++--- .../AdminConfigurableProductDeleteTest.xml | 8 ++++++-- .../AdminDeleteConfigurableProductTest.xml | 4 +++- ...ontConfigurableProductCanAddToCartTest.xml | 4 +++- ...ntConfigurableProductCantAddToCartTest.xml | 5 ++++- .../AdminDeleteDownloadableProductTest.xml | 4 +++- ...UpdatingProductThroughImportingCSVTest.xml | 4 +++- ...tChildImageShouldBeShownOnWishListTest.xml | 4 +++- ...AddMultipleStoreProductsToWishlistTest.xml | 4 +++- 44 files changed, 180 insertions(+), 53 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductInfoMainProductNameActionGroup.xml diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicPriceProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicPriceProductTest.xml index 6924e389451cd..799303db7faad 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicPriceProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicPriceProductTest.xml @@ -50,7 +50,9 @@ </actionGroup> <!-- Verify product on Product Page --> <amOnPage url="{{StorefrontProductPage.url($createDynamicBundleProduct.custom_attributes[url_key]$)}}" stepKey="openBundleProductPage"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoopsMessage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeWhoopsMessage"> + <argument name="value" value="Whoops, our bad..."/> + </actionGroup> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchBySku"> <argument name="query" value="$createDynamicBundleProduct.sku$"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml index 1f2b8435b45f6..f099d67c25b12 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleDynamicProductTest.xml @@ -38,7 +38,9 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!-- Verify product on Product Page --> <amOnPage url="{{StorefrontProductPage.url($$createDynamicBundleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnBundleProductPage"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeWhoops"> + <argument name="value" value="Whoops, our bad..."/> + </actionGroup> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> <argument name="query" value="$$createDynamicBundleProduct.sku$$"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml index b0c1ff7480df6..6192b1d5a3bd4 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteBundleFixedProductTest.xml @@ -35,7 +35,9 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!-- Verify product on Product Page --> <amOnPage url="{{StorefrontProductPage.url($$createFixedBundleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnBundleProductPage"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeWhoops"> + <argument name="value" value="Whoops, our bad..."/> + </actionGroup> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> <argument name="query" value="$$createFixedBundleProduct.sku$$"/> diff --git a/app/code/Magento/BundleImportExport/Test/Mftf/Test/AdminImportBundleProductTest.xml b/app/code/Magento/BundleImportExport/Test/Mftf/Test/AdminImportBundleProductTest.xml index 6e28ebb4e673a..89b0952798773 100644 --- a/app/code/Magento/BundleImportExport/Test/Mftf/Test/AdminImportBundleProductTest.xml +++ b/app/code/Magento/BundleImportExport/Test/Mftf/Test/AdminImportBundleProductTest.xml @@ -262,7 +262,9 @@ <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> <argument name="productUrl" value="{{ImportProduct_Bundle.urlKey}}"/> </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Bundle.name}}" stepKey="seeProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName"> + <argument name="value" value="{{ImportProduct_Bundle.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Bundle.sku}}" stepKey="seeSku"/> <see userInput="From $20.00 To $170.00" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="seePrice"/> <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple1_Bundle.baseImageName)}}" stepKey="seeProduct1BaseImage"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductInfoMainProductNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductInfoMainProductNameActionGroup.xml new file mode 100644 index 0000000000000..13f0228c862d8 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductInfoMainProductNameActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontProductInfoMainProductNameActionGroup"> + <annotations> + <description>Validates that the provided Product Price and Final Product Price are present on the Storefront Product Info Main section on the page.</description> + </annotations> + <arguments> + <argument name="value" type="string"/> + </arguments> + <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{value}}" stepKey="assertElement"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml index a574b0c7eabf3..de2880e4a7c05 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml @@ -69,7 +69,9 @@ <!--Verify Product In Store Front--> <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="goToStorefrontPage"/> <waitForPageLoad stepKey="waitForProductFrontPageToLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductNameInStoreFront"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductNameInStoreFront"> + <argument name="value" value="{{SimpleProduct.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{SimpleProduct.price}}" stepKey="seeProductPriceInStoreFront"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSkuInStoreFront"> <argument name="productSku" value="{{SimpleProduct.sku}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilterTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilterTest.xml index 21256342986ba..4b0cfec56b6c0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilterTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilterTest.xml @@ -77,6 +77,8 @@ <!--Verify product in Store Front Page--> <amOnPage url="{{StorefrontProductPage.url(SimpleProduct.urlKey)}}" stepKey="seeDefaultProductPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageToLoad1"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductInStoreFrontPage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductInStoreFrontPage"> + <argument name="value" value="{{SimpleProduct.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml index 4758bf63859b8..00ef1723ffa30 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml @@ -120,7 +120,9 @@ <waitForPageLoad stepKey="waitForPageToLoad"/> <click selector="{{StorefrontCategoryMainSection.productLink}}" stepKey="openSearchedProduct"/> <waitForPageLoad stepKey="waitForProductToLoad1"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInStoreFront"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductNameInStoreFront"> + <argument name="value" value="$$createConfigProduct.name$$"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigProduct.price$$" stepKey="seeProductPriceInStoreFront"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSkuInStoreFront"> <argument name="productSku" value="$$createConfigProduct.sku$$"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml index 8f56a062c9113..daec3b9cda1d0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml @@ -116,7 +116,9 @@ <waitForPageLoad stepKey="waitForCategoryPageToLoad"/> <click selector="{{StorefrontCategoryMainSection.productLink}}" stepKey="openSearchedProduct"/> <waitForPageLoad stepKey="waitForProductToLoad1"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{SimpleProduct.name}}" stepKey="seeProductNameInStoreFront"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductNameInStoreFront"> + <argument name="value" value="{{SimpleProduct.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{SimpleProduct.price}}" stepKey="seeProductPriceInStoreFront"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSkuInStoreFront"> <argument name="productSku" value="{{SimpleProduct.sku}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml index e6d89b7435c69..cc71d9b571711 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductOutOfStockWithTierPriceTest.xml @@ -71,7 +71,9 @@ <!-- Verify we see created virtual product out of stock with tier price on the storefront page --> <amOnPage url="{{StorefrontProductPage.url(virtualProductOutOfStock.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageToLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{virtualProductOutOfStock.name}}" stepKey="seeVirtualProductNameOnStoreFrontPage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeVirtualProductNameOnStoreFrontPage"> + <argument name="value" value="{{virtualProductOutOfStock.name}}"/> + </actionGroup> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeVirtualProductSku"> <argument name="productSku" value="{{virtualProductOutOfStock.sku}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml index c9670ba5a8a7d..287ad3fe77675 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithCustomOptionsSuiteAndImportOptionsTest.xml @@ -135,7 +135,9 @@ <click selector="{{StorefrontQuickSearchResultsSection.productLink}}" stepKey="openSearchedProduct"/> <!-- Verify we see created virtual product with custom options suite and import options on the storefront page --> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{virtualProductCustomImportOptions.name}}" stepKey="seeVirtualProductNameOnStoreFrontPage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeVirtualProductNameOnStoreFrontPage"> + <argument name="value" value="{{virtualProductCustomImportOptions.name}}"/> + </actionGroup> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeVirtualProductSku"> <argument name="productSku" value="{{virtualProductCustomImportOptions.sku}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithoutManageStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithoutManageStockTest.xml index 83f2f8dae7397..155dfbf8f88e9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithoutManageStockTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateVirtualProductWithoutManageStockTest.xml @@ -61,7 +61,9 @@ <!-- Verify customer see created virtual product without manage stock on the storefront page --> <amOnPage url="{{StorefrontProductPage.url(virtualProductWithoutManageStock.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStoreFrontPageToLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{virtualProductWithoutManageStock.name}}" stepKey="seeVirtualProductNameOnStoreFrontPage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeVirtualProductNameOnStoreFrontPage"> + <argument name="value" value="{{virtualProductWithoutManageStock.name}}"/> + </actionGroup> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeVirtualProductSku"> <argument name="productSku" value="{{virtualProductWithoutManageStock.sku}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml index fd2000a1c5491..c83b46a3a40f4 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml @@ -91,7 +91,9 @@ <waitForPageLoad stepKey="waitForProductToLoad"/> <!--Verify Product is visible and In Stock --> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInStoreFront"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductNameInStoreFront"> + <argument name="value" value="$$createConfigProduct.name$$"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigProduct.price$$" stepKey="seeProductPriceInStoreFront"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSkuInStoreFront"> <argument name="productSku" value="$$createConfigProduct.sku$$"/> @@ -116,7 +118,9 @@ <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="openProductInStoreFront1"/> <waitForPageLoad stepKey="waitForProductToLoad1"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage1"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInStoreFront1"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductNameInStoreFront1"> + <argument name="value" value="$$createConfigProduct.name$$"/> + </actionGroup> <dontSee selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigProduct.price$$" stepKey="dontSeeProductPriceInStoreFront"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeProductSkuInStoreFront1"> <argument name="productSku" value="$$createConfigProduct.sku$$"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml index 2c05b1515bc9c..0c1f59bc1c1d9 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteProductWithCustomOptionTest.xml @@ -36,7 +36,9 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!--Verify product on product page --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeWhoops"> + <argument name="value" value="Whoops, our bad..."/> + </actionGroup> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> <argument name="query" value="$$createSimpleProduct.sku$$"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml index 2c6cc08d7689f..fcca4e5026e77 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteSimpleProductTest.xml @@ -35,7 +35,9 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!--Verify product on Product Page --> <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="amOnSimpleProductPage"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeWhoops"> + <argument name="value" value="Whoops, our bad..."/> + </actionGroup> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> <argument name="query" value="$$createSimpleProduct.sku$$"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml index de72de2769299..2f6dd4ea29222 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteVirtualProductTest.xml @@ -36,7 +36,9 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!--Verify product on product page --> <amOnPage url="{{StorefrontProductPage.url($$createVirtualProduct.custom_attributes[url_key]$$)}}" stepKey="amOnVirtualProductPage"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeWhoops"> + <argument name="value" value="Whoops, our bad..."/> + </actionGroup> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> <argument name="query" value="$$createVirtualProduct.sku$$"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml index ff9d99f76d6bf..96a8f711ea569 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveAnchoredCategoryToDefaultCategoryTest.xml @@ -84,7 +84,9 @@ <!--Verify Product displayed in category store front page--> <click selector="{{StorefrontCategoryMainSection.productLink}}" stepKey="openSearchedProduct"/> <waitForPageLoad stepKey="waitForProductToLoad1"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{defaultSimpleProduct.name}}" stepKey="assertProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="assertProductName"> + <argument name="value" value="{{defaultSimpleProduct.name}}"/> + </actionGroup> <!--Open Category Page--> <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage1"/> @@ -115,6 +117,8 @@ <waitForPageLoad stepKey="waitForProductToLoad2"/> <!--Verify product name on Store Front--> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{defaultSimpleProduct.name}}" stepKey="assertProductNameAfterMove"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="assertProductNameAfterMove"> + <argument name="value" value="{{defaultSimpleProduct.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml index 2a03effb51ae8..14636d8b8ae3d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryFromParentAnchoredCategoryTest.xml @@ -74,7 +74,9 @@ <!--Verify Product displayed in category store front page--> <click selector="{{StorefrontCategoryMainSection.productLink}}" stepKey="openSearchedProduct"/> <waitForPageLoad stepKey="waitForProductToLoad1"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{defaultSimpleProduct.name}}" stepKey="assertProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="assertProductName"> + <argument name="value" value="{{defaultSimpleProduct.name}}"/> + </actionGroup> <!--Open Category Page--> <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage1"/> @@ -109,6 +111,8 @@ <waitForPageLoad stepKey="waitForProductToLoad2"/> <!--Verify product name on Store Front--> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{defaultSimpleProduct.name}}" stepKey="assertProductNameAfterMove"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="assertProductNameAfterMove"> + <argument name="value" value="{{defaultSimpleProduct.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml index 002f11b5adfca..f26e140ebdb20 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveProductBetweenCategoriesTest.xml @@ -144,7 +144,9 @@ <waitForPageLoad stepKey="waitForProductPageLoading"/> <!-- # Product page should open successfully # Breadcrumb for product should be like <Cat 2> --> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$simpleProduct.name$$" stepKey="seeProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName"> + <argument name="value" value="$$simpleProduct.name$$"/> + </actionGroup> <see userInput="$$createSecondCategory.name$$" selector="{{StorefrontNavigationSection.categoryBreadcrumbs}}" stepKey="seeCategoryInBreadcrumbs"/> <!-- Open <Cat1_anchored> category --> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml index edde693c51203..5d260eae2f7d5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminNavigateMultipleUpSellProductsTest.xml @@ -158,7 +158,9 @@ <!--Go to SimpleProduct store front page--> <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductFrontPage"/> <waitForPageLoad stepKey="waitForProduct"/> - <see stepKey="seeProductName" userInput="$$createSimpleProduct.name$$" selector="{{StorefrontProductInfoMainSection.productName}}"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName"> + <argument name="value" value="$$createSimpleProduct.name$$"/> + </actionGroup> <scrollTo stepKey="scrollToTheUpSellHeading" selector="{{StorefrontProductUpSellProductsSection.upSellHeading}}"/> <!--Verify Up Sell Products displayed in SimpleProduct page--> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml index 20fb1f6dc4f49..a078725f1bb01 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithProductsTest.xml @@ -81,7 +81,9 @@ <waitForPageLoad stepKey="waitForProductToLoad1"/> <!--Verify product name and price on Store Front--> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{defaultSimpleProduct.name}}" stepKey="assertProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="assertProductName"> + <argument name="value" value="{{defaultSimpleProduct.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{defaultSimpleProduct.price}}" stepKey="assertProductPrice"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml index a6523c018bdbf..1c543868ee979 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateFlatCategoryAndAddProductsTest.xml @@ -84,12 +84,16 @@ <click stepKey="selectFirstStoreView" selector="{{StorefrontHeaderSection.storeViewList(customStoreEN.name)}}"/> <waitForPageLoad stepKey="waitForFirstStoreView"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$category.name$$)}}" stepKey="seeCategoryOnNavigation"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{defaultSimpleProduct.name}}" stepKey="assertProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="assertProductName"> + <argument name="value" value="{{defaultSimpleProduct.name}}"/> + </actionGroup> <!--Verify product and category is visible in Second Store View --> <click stepKey="selectStoreSwitcher1" selector="{{StorefrontHeaderSection.storeViewSwitcher}}"/> <click stepKey="selectSecondStoreView" selector="{{StorefrontHeaderSection.storeViewList(customStoreFR.name)}}"/> <waitForPageLoad stepKey="waitForSecondStoreView"/> <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$category.name$$)}}" stepKey="seeCategoryOnNavigation1"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{defaultSimpleProduct.name}}" stepKey="seeProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName"> + <argument name="value" value="{{defaultSimpleProduct.name}}"/> + </actionGroup> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml index 39ff6d99b5b75..792c9775267ef 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml @@ -115,7 +115,9 @@ <!-- Verify customer see updated simple product (from the above step) on the storefront page --> <amOnPage url="{{StorefrontProductPage.url(simpleProductEnabledFlat.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{simpleProductEnabledFlat.name}}" stepKey="seeSimpleProductNameOnStoreFrontPage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeSimpleProductNameOnStoreFrontPage"> + <argument name="value" value="{{simpleProductEnabledFlat.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{simpleProductEnabledFlat.price}}" stepKey="seeSimpleProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeSimpleProductSkuOnStoreFrontPage"> <argument name="productSku" value="{{simpleProductEnabledFlat.sku}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml index 2a03187af26ba..cdbb55cf36b2c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockVisibleInCategoryOnlyTest.xml @@ -139,7 +139,9 @@ <!-- Verify customer see updated virtual product and tier price on product page --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice.urlKey)}}" stepKey="goToStorefrontProductPage"/> <waitForPageLoad stepKey="waitForStoreFrontProductPageToLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{updateVirtualProductRegularPrice.name}}" stepKey="seeVirtualProductNameOnStoreFrontPage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeVirtualProductNameOnStoreFrontPage"> + <argument name="value" value="{{updateVirtualProductRegularPrice.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{updateVirtualProductRegularPrice.price}}" stepKey="seeVirtualProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeVirtualProductSku"> <argument name="productSku" value="{{updateVirtualProductRegularPrice.sku}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockWithCustomOptionsVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockWithCustomOptionsVisibleInSearchOnlyTest.xml index 4e0b5a635594c..e2b586adad175 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockWithCustomOptionsVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceInStockWithCustomOptionsVisibleInSearchOnlyTest.xml @@ -214,7 +214,9 @@ <!-- Verify customer see updated virtual product (from the above step) on the storefront page --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPriceInStock.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{updateVirtualProductRegularPriceInStock.name}}" stepKey="seeVirtualProductNameOnStoreFrontPage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeVirtualProductNameOnStoreFrontPage"> + <argument name="value" value="{{updateVirtualProductRegularPriceInStock.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{updateVirtualProductRegularPriceInStock.price}}" stepKey="seeVirtualProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeVirtualProductSku"> <argument name="productSku" value="{{updateVirtualProductRegularPriceInStock.sku}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml index 7f3df4be87bb9..afe2993eb99e1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -83,7 +83,9 @@ <!--Verify customer see updated virtual product with regular price(out of stock) on product storefront page --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice5OutOfStock.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.name}}" stepKey="seeVirtualProductNameOnStoreFrontPage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeVirtualProductNameOnStoreFrontPage"> + <argument name="value" value="{{updateVirtualProductRegularPrice5OutOfStock.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.price}}" stepKey="seeVirtualProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeVirtualProductSku"> <argument name="productSku" value="{{updateVirtualProductRegularPrice5OutOfStock.sku}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml index 3cef25a62775b..66c403df5df2a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInCategoryOnlyTest.xml @@ -103,7 +103,9 @@ <!--Verify customer see updated virtual product (from above step) on product storefront page --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice5OutOfStock.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.name}}" stepKey="seeVirtualProductNameOnStoreFrontPage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeVirtualProductNameOnStoreFrontPage"> + <argument name="value" value="{{updateVirtualProductRegularPrice5OutOfStock.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{updateVirtualProductRegularPrice5OutOfStock.price}}" stepKey="seeVirtualProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeVirtualProductSku"> <argument name="productSku" value="{{updateVirtualProductRegularPrice5OutOfStock.sku}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml index 1e87a10fe753d..ebe1dd6c6889d 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithRegularPriceOutOfStockVisibleInSearchOnlyTest.xml @@ -81,7 +81,9 @@ <!--Verify customer see updated virtual product on storefront page by url key --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductRegularPrice99OutOfStock.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{updateVirtualProductRegularPrice99OutOfStock.name}}" stepKey="seeVirtualProductNameOnStoreFrontPage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeVirtualProductNameOnStoreFrontPage"> + <argument name="value" value="{{updateVirtualProductRegularPrice99OutOfStock.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{updateVirtualProductRegularPrice99OutOfStock.price}}" stepKey="seeVirtualProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeVirtualProductSku"> <argument name="productSku" value="{{updateVirtualProductRegularPrice99OutOfStock.sku}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml index 41c187975a92b..e137db5bfb2b6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceInStockVisibleInCategoryAndSearchTest.xml @@ -125,7 +125,9 @@ <!--Verify customer see updated virtual product with special price(from above step) on product storefront page by url key --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductSpecialPrice.urlKey)}}" stepKey="goToProductStorefrontPage"/> <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{updateVirtualProductSpecialPrice.name}}" stepKey="seeVirtualProductNameOnStoreFrontPage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeVirtualProductNameOnStoreFrontPage"> + <argument name="value" value="{{updateVirtualProductSpecialPrice.name}}"/> + </actionGroup> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeVirtualProductSku"> <argument name="productSku" value="{{updateVirtualProductSpecialPrice.sku}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml index df2e7f530158f..887d8f012826c 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithSpecialPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -105,7 +105,9 @@ <!--Verify customer see updated virtual product with special price(out of stock) on product storefront page --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductSpecialPriceOutOfStock.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{updateVirtualProductSpecialPriceOutOfStock.name}}" stepKey="seeVirtualProductNameOnStoreFrontPage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeVirtualProductNameOnStoreFrontPage"> + <argument name="value" value="{{updateVirtualProductSpecialPriceOutOfStock.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{updateVirtualProductSpecialPriceOutOfStock.price}}" stepKey="seeVirtualProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeVirtualProductSku"> <argument name="productSku" value="{{updateVirtualProductSpecialPriceOutOfStock.sku}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml index 409ed2cd272a2..7eea0f4b79d4e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceInStockVisibleInCategoryOnlyTest.xml @@ -121,7 +121,9 @@ <!--Verify customer see updated virtual product with tier price(from above step) on product storefront page --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualProductWithTierPriceInStock.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{updateVirtualProductWithTierPriceInStock.name}}" stepKey="seeVirtualProductNameOnStoreFrontPage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeVirtualProductNameOnStoreFrontPage"> + <argument name="value" value="{{updateVirtualProductWithTierPriceInStock.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{updateVirtualProductWithTierPriceInStock.price}}" stepKey="seeVirtualProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeVirtualProductSku"> <argument name="productSku" value="{{updateVirtualProductWithTierPriceInStock.sku}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml index 0123c226d3fa8..8d1e7b10fd5fe 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateVirtualProductWithTierPriceOutOfStockVisibleInCategoryAndSearchTest.xml @@ -121,7 +121,9 @@ <!--Verify customer see updated virtual product with tier price(from above step) on product storefront page --> <amOnPage url="{{StorefrontProductPage.url(updateVirtualTierPriceOutOfStock.urlKey)}}" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{updateVirtualTierPriceOutOfStock.name}}" stepKey="seeVirtualProductNameOnStoreFrontPage"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeVirtualProductNameOnStoreFrontPage"> + <argument name="value" value="{{updateVirtualTierPriceOutOfStock.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{updateVirtualTierPriceOutOfStock.price}}" stepKey="seeVirtualProductPriceOnStoreFrontPage"/> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeVirtualProductSku"> <argument name="productSku" value="{{updateVirtualTierPriceOutOfStock.sku}}"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml index 02b21394770c1..d175ebe14fb39 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithDoubleQuoteTest.xml @@ -49,7 +49,9 @@ <!--Open product display page--> <click selector="{{StorefrontCategoryProductSection.ProductTitleByName(SimpleProductNameWithDoubleQuote.name)}}" stepKey="clickProductToGoProductPage"/> <waitForPageLoad stepKey="waitForProductDisplayPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{SimpleProductNameWithDoubleQuote.name}}" stepKey="seeCorrectName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeCorrectName"> + <argument name="value" value="{{SimpleProductNameWithDoubleQuote.name}}"/> + </actionGroup> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeCorrectSku"> <argument name="productSku" value="{{SimpleProductNameWithDoubleQuote.sku}}"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml index 9c248a289ebd4..58f8fafed4067 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml @@ -45,7 +45,9 @@ <click selector="{{StorefrontCategoryProductSection.ProductTitleByName(productWithHTMLEntityOne.name)}}" stepKey="clickProductToGoProductPage"/> <waitForPageLoad stepKey="waitForProductDisplayPageLoad2"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{productWithHTMLEntityOne.name}}" stepKey="seeCorrectName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeCorrectName"> + <argument name="value" value="{{productWithHTMLEntityOne.name}}"/> + </actionGroup> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeCorrectSku"> <argument name="productSku" value="{{productWithHTMLEntityOne.sku}}"/> </actionGroup> diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml index 333c4ab06aad1..ef110cdfff79f 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleTest.xml @@ -69,7 +69,9 @@ <!-- Verify that the simple product page shows the discount --> <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductPage1"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createSimpleProduct.name$$" stepKey="seeCorrectName1"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeCorrectName1"> + <argument name="value" value="$$createSimpleProduct.name$$"/> + </actionGroup> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeCorrectSku1"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> @@ -77,7 +79,9 @@ <!-- Verify that the configurable product page the catalog price rule discount --> <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="goToConfigurableProductPage1"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="seeCorrectName2"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeCorrectName2"> + <argument name="value" value="{{_defaultProduct.name}}"/> + </actionGroup> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeCorrectSku2"> <argument name="productSku" value="{{_defaultProduct.sku}}"/> </actionGroup> @@ -106,7 +110,9 @@ <!-- Verify that the simple product page shows the original price --> <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="goToSimpleProductPage2"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createSimpleProduct.name$$" stepKey="seeCorrectName3"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeCorrectName3"> + <argument name="value" value="$$createSimpleProduct.name$$"/> + </actionGroup> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeCorrectSku3"> <argument name="productSku" value="$$createSimpleProduct.sku$$"/> </actionGroup> @@ -114,7 +120,9 @@ <!-- Verify that the configurable product page shows the original price --> <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="goToConfigurableProductPage2"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{_defaultProduct.name}}" stepKey="seeCorrectName4"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeCorrectName4"> + <argument name="value" value="{{_defaultProduct.name}}"/> + </actionGroup> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="seeCorrectSku4"> <argument name="productSku" value="{{_defaultProduct.sku}}"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml index 5f7d98e3fa91c..36a3595e0c4ee 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductBulkDeleteTest.xml @@ -160,15 +160,21 @@ <!-- after delete, assert product pages are 404 --> <amOnPage url="$$createProduct1.custom_attributes[url_key]$$.html" stepKey="gotoStorefront1"/> <waitForPageLoad stepKey="waitForProduct1"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops1"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeWhoops1"> + <argument name="value" value="Whoops, our bad..."/> + </actionGroup> <dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createProduct1.name$$" stepKey="dontSeeProduct1"/> <amOnPage url="$$createProduct1.custom_attributes[url_key]$$.html" stepKey="gotoStorefront2"/> <waitForPageLoad stepKey="waitForProduct2"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops2"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeWhoops2"> + <argument name="value" value="Whoops, our bad..."/> + </actionGroup> <dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createProduct1.name$$" stepKey="dontSeeProduct2"/> <amOnPage url="$$createProduct1.custom_attributes[url_key]$$.html" stepKey="gotoStorefront3"/> <waitForPageLoad stepKey="waitForProduct3"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops3"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeWhoops3"> + <argument name="value" value="Whoops, our bad..."/> + </actionGroup> <dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createProduct1.name$$" stepKey="dontSeeProduct3"/> </test> </tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml index 56f74e4ff1fcd..b2fe25e9691a3 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductDeleteTest/AdminConfigurableProductDeleteTest.xml @@ -77,7 +77,9 @@ <!-- assert product visible in storefront --> <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="gotoStorefront1"/> <waitForPageLoad stepKey="wait1"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProduct"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProduct"> + <argument name="value" value="$$createConfigProduct.name$$"/> + </actionGroup> <!-- go to admin and delete --> <actionGroup ref="AdminLoginActionGroup" stepKey="login"/> @@ -96,7 +98,9 @@ <!-- after delete, assert product page is 404 --> <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="gotoStorefront2"/> <waitForPageLoad stepKey="wait3"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeWhoops"> + <argument name="value" value="Whoops, our bad..."/> + </actionGroup> <dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="dontSeeProduct"/> </test> </tests> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml index 7eef88f7317a0..70e1f80ee395c 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminDeleteConfigurableProductTest.xml @@ -34,7 +34,9 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!-- Verify product on Product Page --> <amOnPage url="{{StorefrontProductPage.url($$createConfigurableProduct.custom_attributes[url_key]$$)}}" stepKey="amOnConfigurableProductPage"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeWhoops"> + <argument name="value" value="Whoops, our bad..."/> + </actionGroup> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchBarByProductSku"> <argument name="query" value="$$createConfigurableProduct.sku$$"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml index f0acc3834f7a6..432881c729fe7 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml @@ -49,7 +49,9 @@ <!-- Verify adding configurable product to cart after an option is selected in storefront product view --> <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/> <waitForPageLoad stepKey="wait"/> - <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName"> + <argument name="value" value="{{_defaultProduct.name}}"/> + </actionGroup> <selectOption userInput="{{colorProductAttribute1.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> <waitForElementVisible selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="waitForAddToCartVisible"/> <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml index 13568701ecc6e..780e2ae7650d6 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml @@ -49,7 +49,10 @@ <!-- Verify not able to add configurable product to cart when no option is selected in storefront product view --> <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/> <waitForPageLoad stepKey="wait"/> - <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeProductName"/> + <see userInput="" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName"> + <argument name="value" value="{{StorefrontProductInfoMainSection.productName}}"/> + </actionGroup> <waitForElementVisible selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="waitForAddToCartVisible"/> <click selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="clickAddToCart"/> <see userInput="This is a required field" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsError}}" stepKey="seeError"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml index 6e7a1a65572ab..686390f7e618a 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminDeleteDownloadableProductTest.xml @@ -42,7 +42,9 @@ <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="A total of 1 record(s) have been deleted." stepKey="deleteMessage"/> <!--Verify product on Product Page --> <amOnPage url="{{StorefrontProductPage.url($$createDownloadableProduct.custom_attributes[url_key]$$)}}" stepKey="amOnDownloadableProductPage"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="seeWhoops"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeWhoops"> + <argument name="value" value="Whoops, our bad..."/> + </actionGroup> <!-- Search for the product by sku --> <actionGroup ref="StoreFrontQuickSearchActionGroup" stepKey="searchByCreatedTerm"> <argument name="query" value="$$createDownloadableProduct.sku$$"/> diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminURLKeyWorksWhenUpdatingProductThroughImportingCSVTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminURLKeyWorksWhenUpdatingProductThroughImportingCSVTest.xml index fe5f4358bfca3..6c2d7f76cce32 100644 --- a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminURLKeyWorksWhenUpdatingProductThroughImportingCSVTest.xml +++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminURLKeyWorksWhenUpdatingProductThroughImportingCSVTest.xml @@ -43,7 +43,9 @@ <amOnPage url="{{StorefrontProductPage.url('simpleprod')}}" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <seeInCurrentUrl url="{{StorefrontProductPage.url('simpleprod')}}" stepKey="seeUpdatedUrl"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createProduct.name$$" stepKey="assertProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="assertProductName"> + <argument name="value" value="$$createProduct.name$$"/> + </actionGroup> <actionGroup ref="StorefrontAssertProductSkuOnProductPageActionGroup" stepKey="assertProductSku"> <argument name="productSku" value="$$createProduct.sku$$"/> </actionGroup> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml index 8983bb4cc9b76..d5d187b2f5786 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/ConfigurableProductChildImageShouldBeShownOnWishListTest.xml @@ -89,7 +89,9 @@ <waitForPageLoad stepKey="waitForLogin"/> <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/> <waitForPageLoad stepKey="wait3"/> - <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName"> + <argument name="value" value="{{_defaultProduct.name}}"/> + </actionGroup> <selectOption userInput="{{colorProductAttribute1.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> <waitForElementVisible selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="waitForAddToCartVisible"/> <click selector="{{StorefrontProductPageSection.addToWishlist}}" stepKey="addFirstProductToWishlist"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml index 8fe3d3c707900..129c8c267de43 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml @@ -95,7 +95,9 @@ <see userInput="$$customer.email$$" selector="{{StorefrontCustomerDashboardAccountInformationSection.ContactInformation}}" stepKey="seeEmail"/> <!-- Add product visible on default store to wishlist --> <amOnPage url="{{StorefrontProductPage.url($$product.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPageOnDefaultStore"/> - <see userInput="$$product.name$$" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertFirstProductNameTitle"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="assertFirstProductNameTitle"> + <argument name="value" value="$$product.name$$"/> + </actionGroup> <click selector="{{StorefrontProductPageSection.addToWishlist}}" stepKey="addFirstProductToWishlist"/> <!-- Switch to second store and add second product (visible on second store) to wishlist --> <click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="clickSwitchStoreButtonOnDefaultStore"/> From a9947c5a2732336185ad19c86a0e2cb089274087 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Wed, 23 Jun 2021 17:34:37 +0300 Subject: [PATCH 04/35] Fixed typos --- .../AssertStorefrontProductInfoMainProductNameActionGroup.xml | 2 +- .../StorefrontConfigurableProductCantAddToCartTest.xml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductInfoMainProductNameActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductInfoMainProductNameActionGroup.xml index 13f0228c862d8..b751678e69dc0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductInfoMainProductNameActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductInfoMainProductNameActionGroup.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AssertStorefrontProductInfoMainProductNameActionGroup"> <annotations> - <description>Validates that the provided Product Price and Final Product Price are present on the Storefront Product Info Main section on the page.</description> + <description>Validates that the provided Product name are present on the Storefront Product Info Main section on the page.</description> </annotations> <arguments> <argument name="value" type="string"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml index 780e2ae7650d6..79ba923aa12fe 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml @@ -49,9 +49,8 @@ <!-- Verify not able to add configurable product to cart when no option is selected in storefront product view --> <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/> <waitForPageLoad stepKey="wait"/> - <see userInput="" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="seeProductName"/> <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName"> - <argument name="value" value="{{StorefrontProductInfoMainSection.productName}}"/> + <argument name="value" value="{{_defaultProduct.name}}"/> </actionGroup> <waitForElementVisible selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="waitForAddToCartVisible"/> <click selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="clickAddToCart"/> From e5b2137c6d4c8c55991d4916fa5e72b3922c6cc7 Mon Sep 17 00:00:00 2001 From: Dmitry Tsymbal <d.stymbal@atwix.com> Date: Mon, 28 Jun 2021 17:22:04 +0300 Subject: [PATCH 05/35] Shipping To Multiple Addresses If Maximum QTY Limit Was Reached --- ...roductQTYOnShoppingCartPageActionGroup.xml | 20 +++++++ .../Section/CheckoutCartSummarySection.xml | 1 + ...otPresentOnShoppingCartPageActionGroup.xml | 14 +++++ ...IsPresentOnShoppingCartPageActionGroup.xml | 14 +++++ .../Mftf/Data/MultishippingConfigData.xml | 20 +++++++ ...dressesIfMaximumQtyLimitWasReachedTest.xml | 60 +++++++++++++++++++ 6 files changed, 129 insertions(+) create mode 100644 app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontUpdateProductQTYOnShoppingCartPageActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AssertStorefrontMultiShippingOptionIsNotPresentOnShoppingCartPageActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AssertStorefrontMultiShippingOptionIsPresentOnShoppingCartPageActionGroup.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/Data/MultishippingConfigData.xml create mode 100644 app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutShippingToMultipleAddressesIfMaximumQtyLimitWasReachedTest.xml diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontUpdateProductQTYOnShoppingCartPageActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontUpdateProductQTYOnShoppingCartPageActionGroup.xml new file mode 100644 index 0000000000000..7da9e4e8030e4 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontUpdateProductQTYOnShoppingCartPageActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontUpdateProductQTYOnShoppingCartPageActionGroup"> + <arguments> + <argument name="product" type="entity"/> + <argument name="qty" type="string"/> + </arguments> + <fillField selector="{{CheckoutCartProductSection.ProductQuantityByName(product)}}" userInput="{{qty}}" stepKey="changeCartQty"/> + <click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="clickUpdateShoppingCart"/> + <waitForPageLoad stepKey="waitForCheckoutPageLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml index 8804fc33e6b31..e589dc8b57de0 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartSummarySection.xml @@ -37,5 +37,6 @@ <element name="shippingPrice" type="text" selector="#co-shipping-method-form span .price"/> <element name="shippingMethodElementId" type="radio" selector="#s_method_{{carrierCode}}_{{methodCode}}" parameterized="true" timeout="30"/> <element name="estimateShippingAndTaxForm" type="block" selector="#shipping-zip-form"/> + <element name="checkoutWithMultipleAddresses" type="button" selector=".cart-summary .action.multicheckout"/> </section> </sections> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AssertStorefrontMultiShippingOptionIsNotPresentOnShoppingCartPageActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AssertStorefrontMultiShippingOptionIsNotPresentOnShoppingCartPageActionGroup.xml new file mode 100644 index 0000000000000..018e979a63228 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AssertStorefrontMultiShippingOptionIsNotPresentOnShoppingCartPageActionGroup.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontMultiShippingOptionIsNotPresentOnShoppingCartPageActionGroup"> + <dontSeeElement selector="{{CheckoutCartSummarySection.checkoutWithMultipleAddresses}}" stepKey="seeMultiCheckoutBtn"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AssertStorefrontMultiShippingOptionIsPresentOnShoppingCartPageActionGroup.xml b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AssertStorefrontMultiShippingOptionIsPresentOnShoppingCartPageActionGroup.xml new file mode 100644 index 0000000000000..8f766cd401cd4 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AssertStorefrontMultiShippingOptionIsPresentOnShoppingCartPageActionGroup.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AssertStorefrontMultiShippingOptionIsPresentOnShoppingCartPageActionGroup"> + <seeElement selector="{{CheckoutCartSummarySection.checkoutWithMultipleAddresses}}" stepKey="dontSeeMultiCheckoutBtn"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Data/MultishippingConfigData.xml b/app/code/Magento/Multishipping/Test/Mftf/Data/MultishippingConfigData.xml new file mode 100644 index 0000000000000..b4ce98b1e8ad7 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Data/MultishippingConfigData.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="MaximumQtyAllowed2ForShippingToMultipleAddressesConfigData"> + <data key="path">multishipping/options/checkout_multiple_maximum_qty</data> + <data key="value">2</data> + </entity> + <!-- Magento Default Value --> + <entity name="MaximumQtyAllowed100ForShippingToMultipleAddressesConfigData"> + <data key="path">multishipping/options/checkout_multiple_maximum_qty</data> + <data key="value">100</data> + </entity> +</entities> diff --git a/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutShippingToMultipleAddressesIfMaximumQtyLimitWasReachedTest.xml b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutShippingToMultipleAddressesIfMaximumQtyLimitWasReachedTest.xml new file mode 100644 index 0000000000000..5a6c674719170 --- /dev/null +++ b/app/code/Magento/Multishipping/Test/Mftf/Test/StorefrontCheckoutShippingToMultipleAddressesIfMaximumQtyLimitWasReachedTest.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCheckoutShippingToMultipleAddressesIfMaximumQtyLimitWasReachedTest"> + <annotations> + <features value="Sales"/> + <stories value="Order Placement With Maximum QTY Limit for Shipping To Multiple Addresses"/> + <title value="Maximum QTY Limit for Shipping To Multiple Addresses Was Reached"/> + <description value="Customer should not be able ship to multiple addresses if Maximum QTY limit was reached in shopping cart"/> + <severity value="MAJOR"/> + <group value="checkout"/> + </annotations> + <before> + <magentoCLI command="config:set {{MaximumQtyAllowed2ForShippingToMultipleAddressesConfigData.path}} {{MaximumQtyAllowed2ForShippingToMultipleAddressesConfigData.value}}" stepKey="setMaximumQty2"/> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="SimpleSubCategory" stepKey="createCategory"/> + <createData entity="SimpleProduct" stepKey="createProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + </before> + <after> + <magentoCLI command="config:set {{MaximumQtyAllowed100ForShippingToMultipleAddressesConfigData.path}} {{MaximumQtyAllowed100ForShippingToMultipleAddressesConfigData.value}}" stepKey="setDefaultMaximumQty"/> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> + <argument name="tags" value="config full_page"/> + </actionGroup> + </after> + + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$createCustomer$"/> + </actionGroup> + <actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory"> + <argument name="category" value="$createCategory$"/> + <argument name="product" value="$createProduct$"/> + </actionGroup> + <actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addProductToTheCart"> + <argument name="productQty" value="1"/> + </actionGroup> + <actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="navigateToCartPage"/> + <actionGroup ref="AssertStorefrontMultiShippingOptionIsPresentOnShoppingCartPageActionGroup" stepKey="assertMultiCheckoutAvailable"/> + <actionGroup ref="StorefrontUpdateProductQTYOnShoppingCartPageActionGroup" stepKey="updateProductQty"> + <argument name="product" value="$createProduct.name$"/> + <argument name="qty" value="3"/> + </actionGroup> + <actionGroup ref="AssertStorefrontMultiShippingOptionIsNotPresentOnShoppingCartPageActionGroup" stepKey="assertMultiCheckoutIsNotAvailable"/> + </test> +</tests> From 9f06c5f9fed5e123b9986160be8ff15a9de39474 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 19 Jul 2021 17:53:54 +0300 Subject: [PATCH 06/35] refactored --- ...AddOptionOnCreateBundlePageActionGroup.xml | 17 +++ ...roductToOptionByOptionIndexActionGroup.xml | 23 +++ .../AdminFillBundleItemQtyActionGroup.xml | 23 +++ .../AdminFillBundleOptionTitleActionGroup.xml | 20 +++ .../AdminFillBundleOptionTypeActionGroup.xml | 22 +++ ...OpenCreateBundleProductPageActionGroup.xml | 19 +++ .../Section/AdminProductFormBundleSection.xml | 2 + .../Mftf/Test/AdminAddBundleItemsTest.xml | 134 +++++++++--------- ...ddProductsToOptionPanelGridActionGroup.xml | 18 +++ ...sOnAddProductsToOptionPanelActionGroup.xml | 18 +++ 10 files changed, 232 insertions(+), 64 deletions(-) create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddOptionOnCreateBundlePageActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddProductToOptionByOptionIndexActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminFillBundleItemQtyActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminFillBundleOptionTitleActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminFillBundleOptionTypeActionGroup.xml create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminOpenCreateBundleProductPageActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup.xml diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddOptionOnCreateBundlePageActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddOptionOnCreateBundlePageActionGroup.xml new file mode 100644 index 0000000000000..0327c435c2d04 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddOptionOnCreateBundlePageActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickAddOptionOnBundleProductEditPageActionGroup"> + <annotations> + <description>Clicks the "Add Option" button on the Bundle Product Edit page</description> + </annotations> + <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddProductToOptionByOptionIndexActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddProductToOptionByOptionIndexActionGroup.xml new file mode 100644 index 0000000000000..48e2899f3c448 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddProductToOptionByOptionIndexActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickAddProductToOptionByOptionIndexActionGroup"> + <annotations> + <description>Clicks "Add Product To Option" button for Option by index for bundle product.</description> + </annotations> + <arguments> + <argument name="optionIndex" type="string" defaultValue="1"/> + </arguments> + + <waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(optionIndex)}}" stepKey="waitForAddProductsToBundle"/> + <click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(optionIndex)}}" stepKey="clickAddProductsToOption"/> + <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminFillBundleItemQtyActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminFillBundleItemQtyActionGroup.xml new file mode 100644 index 0000000000000..b5a195add6e20 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminFillBundleItemQtyActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillBundleItemQtyActionGroup"> + <annotations> + <description>Fills Bundle item qty</description> + </annotations> + <arguments> + <argument name="optionIndex" type="string" defaultValue="0"/> + <argument name="productIndex" type="string" defaultValue="0"/> + <argument name="qty" type="string" defaultValue="0"/> + </arguments> + + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity(optionIndex, productIndex)}}" userInput="{{qty}}" stepKey="fillProductDefaultQty"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminFillBundleOptionTitleActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminFillBundleOptionTitleActionGroup.xml new file mode 100644 index 0000000000000..7aaa6a8d596cf --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminFillBundleOptionTitleActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillBundleOptionTitleActionGroup"> + <arguments> + <argument name="optionTitle" type="string" defaultValue="option1"/> + <argument name="index" type="string" defaultValue="0"/> + </arguments> + + <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle(index)}}" stepKey="waitForBundleOptions"/> + <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle(index)}}" userInput="{{optionTitle}}" stepKey="fillOptionTitle"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminFillBundleOptionTypeActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminFillBundleOptionTypeActionGroup.xml new file mode 100644 index 0000000000000..9e3c2091b84c6 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminFillBundleOptionTypeActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminFillBundleOptionTypeActionGroup"> + <annotations> + <description>Fills Bundle Option Type</description> + </annotations> + <arguments> + <argument name="optionType" type="string" defaultValue="Checkbox"/> + <argument name="optionIndex" type="string" defaultValue="0"/> + </arguments> + + <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType(optionIndex)}}" userInput="{{optionType}}" stepKey="fillOptionType"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminOpenCreateBundleProductPageActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminOpenCreateBundleProductPageActionGroup.xml new file mode 100644 index 0000000000000..7e01f0ebc0839 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminOpenCreateBundleProductPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminOpenCreateBundleProductPageActionGroup"> + <annotations> + <description>Opens the Create Product page for Bundle</description> + </annotations> + + <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/> + <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml b/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml index 213131c5ed652..6ced817259e36 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml @@ -29,6 +29,7 @@ <element name="bundleOptionXProductYPrice" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_price_value]']" parameterized="true"/> <element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/> <element name="nthAddProductsToOption" type="button" selector="//tr[{{var}}]//button[@data-index='modal_set']" timeout="30" parameterized="true"/> + <element name="nthOptions" type="text" selector="//tr[{{var}}]//span[@data-index='sku']" timeout="30" parameterized="true"/> <element name="bundlePriceType" type="select" selector="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]"/> <element name="bundlePriceValue" type="input" selector="bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]"/> <!--Select"url Key"InputForm--> @@ -75,6 +76,7 @@ <element name="priceField" type="input" selector="//div[@data-index='price']//input"/> <element name="listedBundleItem" type="text" selector="//tr[@data-repeat-index='0']//div"/> <element name="listedBundleItem2" type="text" selector="//tr[@data-repeat-index='2']//div"/> + <element name="bundleItem" type="text" selector="//span[@data-index='sku']"/> <!--FirstProductOption--> <element name="firstProductOption" type="checkbox" selector="//div[@class='admin__data-grid-outer-wrap']//tr[@data-repeat-index='0']//input[@type='checkbox']"/> <element name="dynamicSkuToggle" type="checkbox" selector="div[data-index='sku_type'] .admin__actions-switch-label" timeout="30"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml index 39d026ac74731..318f45e1c7a11 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml @@ -19,47 +19,44 @@ <group value="Bundle"/> </annotations> <before> - <!--Creating data--> <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> <createData entity="SimpleProduct2" stepKey="simpleProduct0"/> <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> <createData entity="SimpleProduct2" stepKey="simpleProduct3"/> <magentoCron stepKey="runCronIndex" groups="index"/> - <!--Admin login--> <actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/> </before> <after> - <!--Deleting data--> <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> <deleteData createDataKey="simpleProduct0" stepKey="deleteSimpleProduct0"/> <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> <deleteData createDataKey="simpleProduct3" stepKey="deleteSimpleProduct3"/> - <!--Logging out--> + <actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProductBySku"> + <argument name="sku" value="{{BundleProduct.sku}}"/> + </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!--Go to bundle product creation page--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/> - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> - - <!-- Add two bundle items --> - <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> - <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/> - <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/> - <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/> - <actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption"/> + + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/> + <actionGroup ref="AdminClickAddOptionOnBundleProductEditPageActionGroup" stepKey="clickAddOption3"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleOptions"/> + <actionGroup ref="AdminFillBundleOptionTitleActionGroup" stepKey="fillOptionTitle"> + <argument name="optionTitle" value="{{BundleProduct.optionTitle1}}"/> + </actionGroup> + <actionGroup ref="AdminFillBundleOptionTypeActionGroup" stepKey="selectInputType"/> + <actionGroup ref="AdminClickAddProductToOptionByOptionIndexActionGroup" stepKey="clickAddProductsToOption"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct0$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> - <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <!-- Check that Bundle Options initialized with default quantity --> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup" stepKey="clickAddSelectedBundleProducts"/> <grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantity"/> <assertEquals stepKey="assertFirstBundleOptionDefaultQuantity"> <expectedResult type="string">1</expectedResult> @@ -70,57 +67,62 @@ <expectedResult type="string">1</expectedResult> <actualResult type="string">$grabbedSecondBundleOptionQuantity</actualResult> </assertEquals> - - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> - - <!--Fill out ancillary data on bundle product--> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> <argument name="bundleProduct" value="BundleProduct"/> </actionGroup> - - <!--Save the product--> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButton"/> <see userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/> - <!--Checking on admin side--> <scrollToTopOfPage stepKey="scroll"/> <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems2"/> <seeElement stepKey="LookingForBundleItemPresence" selector="{{AdminProductFormBundleSection.listedBundleItem}}"/> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="GoToProductPage"> + <argument name="productUrlKey" value="{{BundleProduct.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="LookingForAbilityToAddOptions"/> - <!--Checking on customer side--> - <amOnPage url="{{BundleProduct.urlKey}}.html" stepKey="GoToProductPage"/> - <waitForPageLoad stepKey="waitForBundleProductPageToLoad"/> - <seeElement selector="{{StorefrontBundledSection.customizeProduct}}" stepKey="LookingForAbilityToAddOptions"/> - <click selector="{{StorefrontBundledSection.customizeProduct}}" stepKey="clickButtonToCustomize"/> - <waitForPageLoad stepKey="waitCustomizationDropDown"/> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickButtonToCustomize"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitCustomizationDropDown"/> <seeElement selector="{{StorefrontBundledSection.customizableBundleItemOption}}" stepKey="seeBundleItem"/> - <!--Add another bundle option with 2 items--> - <!--Go to bundle product creation page--> <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/> - <conditionalClick selector="{{AdminProductFiltersSection.filtersClear}}" dependentSelector="{{AdminProductFiltersSection.filtersClear}}" visible="true" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/> - <waitForPageLoad stepKey="WaitForClear"/> + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="WaitForClear"/> <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName"> <argument name="product" value="BundleProduct"/> </actionGroup> - <click selector="{{AdminProductFormBundleSection.addOptions}}" stepKey="clickOnBundleProductToEdit"/> - <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItemsToEdit"/> - <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/> - <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('1')}}" stepKey="waitForBundleOptionsToAppear"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('1')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillNewestOptionTitle"/> - <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('1')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectNewInputType"/> - <actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToNewOption"/> + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="clickOnBundleProductToEdit"/> + <actionGroup ref="AdminClickAddOptionOnBundleProductEditPageActionGroup" stepKey="clickAddOption"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleOptionsToAppear"/> + <actionGroup ref="AdminFillBundleOptionTitleActionGroup" stepKey="fillNewestOptionTitle"> + <argument name="optionTitle" value="{{BundleProduct.optionTitle1}}_new"/> + <argument name="index" value="1"/> + </actionGroup> + <actionGroup ref="AdminFillBundleOptionTypeActionGroup" stepKey="selectNewInputType"> + <argument name="optionIndex" value="1"/> + </actionGroup> + <actionGroup ref="AdminClickAddProductToOptionByOptionIndexActionGroup" stepKey="clickAddProductsToNewOption"> + <argument name="optionIndex" value="2"/> + </actionGroup> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterNewBundleProductOptions"> - <argument name="product" value="$$simpleProduct2$$"/> + <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="//div[@class='admin__data-grid-outer-wrap']//tr[@data-repeat-index='0']//input[@type='checkbox']" stepKey="selectNewFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectNewFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterNewBundleProductOptions2"> - <argument name="product" value="$$simpleProduct3$$"/> + <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> - <checkOption selector="{{AdminProductFormBundleSection.firstProductOption}}" stepKey="selectNewFirstGridRow2"/> - <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddNewSelectedBundleProducts"/> - <!-- Check that existing Bundle Options do not loose user input quantity values --> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectNewFirstGridRow2"/> + <actionGroup ref="AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup" stepKey="clickAddNewSelectedBundleProducts"/> <grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantityAfterUserInput"/> <assertEquals stepKey="assertFirstBundleOptionDefaultQuantityAfterUserInput"> <expectedResult type="string">{{BundleProduct.defaultQuantity}}</expectedResult> @@ -131,24 +133,28 @@ <expectedResult type="string">{{BundleProduct.defaultQuantity}}</expectedResult> <actualResult type="string">$grabbedSecondBundleOptionQuantityAfterUserInput</actualResult> </assertEquals> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '2')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillNewProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '3')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillNewProductDefaultQty2"/> - - <!--Save the product--> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillNewProductDefaultQty1"> + <argument name="optionIndex" value="1"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillNewProductDefaultQty2"> + <argument name="optionIndex" value="1"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButtonAgain"/> <see userInput="You saved the product." stepKey="messageYouSavedTheProductIsShownAgain"/> - - <!--Checking on admin side--> <scrollToTopOfPage stepKey="scrollAgain"/> - <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenNewSectionBundleItems2"/> - <seeElement selector="{{AdminProductFormBundleSection.listedBundleItem2}}" stepKey="LookingForNewBundleItemPresence"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="conditionallyOpenNewSectionBundleItems2"/> + <see userInput="$$simpleProduct2.sku$$" selector="{{AdminProductFormBundleSection.bundleItem}}" stepKey="LookingForNewBundleItemPresence"/> - <!--Checking on customer side--> - <amOnPage url="{{BundleProduct.urlKey}}.html" stepKey="GoToProductPageAgain"/> - <waitForPageLoad stepKey="waitForBundleProductPageToLoadAgain"/> - <seeElement selector="{{StorefrontBundledSection.customizeProduct}}" stepKey="LookingForAbilityToAddBothOptions"/> - <click selector="{{StorefrontBundledSection.customizeProduct}}" stepKey="clickButtonAgainToCustomize"/> - <waitForPageLoad stepKey="waitForBothCustomizationDropDown"/> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="GoToProductPageAgain"> + <argument name="productUrlKey" value="{{BundleProduct.urlKey}}"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductPageToLoadAgain"/> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="LookingForAbilityToAddBothOptions"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBothCustomizationDropDown"/> <seeElement selector="{{StorefrontBundledSection.customizableBundleItemOption2}}" stepKey="seeBundleItems"/> </test> </tests> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup.xml new file mode 100644 index 0000000000000..12faba1cde559 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup"> + <annotations> + <description>Checks the first checkbox in the Grid</description> + </annotations> + + <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup.xml new file mode 100644 index 0000000000000..9d5ccb6e0e53f --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup"> + <annotations> + <description>Clicks the "Add Selected Products" button on the "Add Products To Option" Panel </description> + </annotations> + + <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> + </actionGroup> +</actionGroups> From 987ace74a945691500005f45ff32cdcd171a6ee9 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 19 Jul 2021 18:16:32 +0300 Subject: [PATCH 07/35] refactored --- ...ckAddOptionOnCreateBundlePageActionGroup.xml | 17 ----------------- ...dProductToOptionByOptionIndexActionGroup.xml | 8 ++++---- .../Section/AdminProductFormBundleSection.xml | 1 - .../Test/Mftf/Test/AdminAddBundleItemsTest.xml | 4 ++++ ...ctsOnAddProductsToOptionPanelActionGroup.xml | 2 +- 5 files changed, 9 insertions(+), 23 deletions(-) delete mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddOptionOnCreateBundlePageActionGroup.xml diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddOptionOnCreateBundlePageActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddOptionOnCreateBundlePageActionGroup.xml deleted file mode 100644 index 0327c435c2d04..0000000000000 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddOptionOnCreateBundlePageActionGroup.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - /** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ ---> - -<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminClickAddOptionOnBundleProductEditPageActionGroup"> - <annotations> - <description>Clicks the "Add Option" button on the Bundle Product Edit page</description> - </annotations> - <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/> - </actionGroup> -</actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddProductToOptionByOptionIndexActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddProductToOptionByOptionIndexActionGroup.xml index 48e2899f3c448..a5193eede1792 100644 --- a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddProductToOptionByOptionIndexActionGroup.xml +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddProductToOptionByOptionIndexActionGroup.xml @@ -10,14 +10,14 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <actionGroup name="AdminClickAddProductToOptionByOptionIndexActionGroup"> <annotations> - <description>Clicks "Add Product To Option" button for Option by index for bundle product.</description> + <description>Clicks "Add Product To Option" button for Option by index for Bundle</description> </annotations> <arguments> <argument name="optionIndex" type="string" defaultValue="1"/> </arguments> - <waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(optionIndex)}}" stepKey="waitForAddProductsToBundle"/> - <click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(optionIndex)}}" stepKey="clickAddProductsToOption"/> - <waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> + <waitForElementVisible selector="{{AdminProductFormBundleSection.nthAddProductsToOption(optionIndex)}}" stepKey="waitForAddProductsToOptionButton"/> + <click selector="{{AdminProductFormBundleSection.nthAddProductsToOption(optionIndex)}}" stepKey="clickAddProductsToOptionButton"/> + <waitForPageLoad stepKey="waitForPageLoadAfterAddingPorductsToBundle"/> </actionGroup> </actionGroups> diff --git a/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml b/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml index 6ced817259e36..caa93c8b4a575 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.xml @@ -29,7 +29,6 @@ <element name="bundleOptionXProductYPrice" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_price_value]']" parameterized="true"/> <element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/> <element name="nthAddProductsToOption" type="button" selector="//tr[{{var}}]//button[@data-index='modal_set']" timeout="30" parameterized="true"/> - <element name="nthOptions" type="text" selector="//tr[{{var}}]//span[@data-index='sku']" timeout="30" parameterized="true"/> <element name="bundlePriceType" type="select" selector="bundle_options[bundle_options][0][bundle_selections][0][selection_price_type]"/> <element name="bundlePriceValue" type="input" selector="bundle_options[bundle_options][0][bundle_selections][0][selection_price_value]"/> <!--Select"url Key"InputForm--> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml index 318f45e1c7a11..20f16145d80d5 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml @@ -41,6 +41,7 @@ <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="conditionallyOpenSectionBundleItems"/> <actionGroup ref="AdminClickAddOptionOnBundleProductEditPageActionGroup" stepKey="clickAddOption3"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleOptions"/> <actionGroup ref="AdminFillBundleOptionTitleActionGroup" stepKey="fillOptionTitle"> @@ -89,6 +90,7 @@ <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="GoToProductPage"> <argument name="productUrlKey" value="{{BundleProduct.urlKey}}"/> </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductPageToLoad"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="LookingForAbilityToAddOptions"/> <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickButtonToCustomize"/> @@ -102,6 +104,7 @@ <argument name="product" value="BundleProduct"/> </actionGroup> <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="clickOnBundleProductToEdit"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="conditionallyOpenSectionBundleItemsToEdit"/> <actionGroup ref="AdminClickAddOptionOnBundleProductEditPageActionGroup" stepKey="clickAddOption"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleOptionsToAppear"/> <actionGroup ref="AdminFillBundleOptionTitleActionGroup" stepKey="fillNewestOptionTitle"> @@ -154,6 +157,7 @@ </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductPageToLoadAgain"/> <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="LookingForAbilityToAddBothOptions"/> + <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickButtonAgainToCustomize"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBothCustomizationDropDown"/> <seeElement selector="{{StorefrontBundledSection.customizableBundleItemOption2}}" stepKey="seeBundleItems"/> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup.xml index 9d5ccb6e0e53f..74ea7b71c9e12 100644 --- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup.xml +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup.xml @@ -13,6 +13,6 @@ <description>Clicks the "Add Selected Products" button on the "Add Products To Option" Panel </description> </annotations> - <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> + <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedProducts"/> </actionGroup> </actionGroups> From cca680d0d9becdb7ae12a67cabe3e2c08b687c13 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 20 Jul 2021 09:30:46 +0300 Subject: [PATCH 08/35] added ActionGroup --- ...OptionOnBundleProductEditPageActionGroup.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddOptionOnBundleProductEditPageActionGroup.xml diff --git a/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddOptionOnBundleProductEditPageActionGroup.xml b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddOptionOnBundleProductEditPageActionGroup.xml new file mode 100644 index 0000000000000..0327c435c2d04 --- /dev/null +++ b/app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminClickAddOptionOnBundleProductEditPageActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickAddOptionOnBundleProductEditPageActionGroup"> + <annotations> + <description>Clicks the "Add Option" button on the Bundle Product Edit page</description> + </annotations> + <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption"/> + </actionGroup> +</actionGroups> From e6ed8085bb5d349ac5ea76a750a367ed872b0f10 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 22 Jul 2021 09:45:57 +0300 Subject: [PATCH 09/35] refactored to decrease execution time --- .../Magento/Backend/Block/Store/Switcher.php | 27 +- .../Test/Mftf/Page/AdminOrderViewPage.xml | 10 + .../Test/Unit/Block/Store/SwitcherTest.php | 157 ++++++- .../Magento/Catalog/Model/Product/Copier.php | 30 +- .../DuplicatedProductAttributesCopier.php | 99 +++++ .../ResourceModel/Product/Collection.php | 4 +- .../Indexer/Price/Query/BaseFinalPrice.php | 2 +- .../Test/Unit/Model/Product/CopierTest.php | 394 ------------------ .../Products/DataProvider/ProductSearch.php | 13 +- .../CatalogRule/Cron/DailyCatalogUpdate.php | 21 +- .../Model/Indexer/PartialIndex.php | 97 ----- .../Test/Unit/Cron/DailyCatalogUpdateTest.php | 62 ++- app/code/Magento/CatalogRule/etc/mview.xml | 1 - ...WithSignInLinkForEmailVerificationTest.xml | 54 +++ .../web/js/model/checkout-data-resolver.js | 12 +- .../frontend/web/template/authentication.html | 12 +- .../Attribute/ScopedOptionSelectBuilder.php | 61 +++ .../ConfigurableProduct/etc/frontend/di.xml | 1 + .../Model/Variant/Collection.php | 9 +- .../etc/graphql/di.xml | 1 + .../Test/StorefrontVerifySecureCookieTest.xml | 5 + .../StorefrontVerifyUnsecureCookieTest.xml | 5 + .../StorefrontCustomerOrderViewSection.xml | 1 + .../Model/Adapter/Index/Builder.php | 12 +- .../Collection/SearchResultApplier.php | 17 +- .../Magento/Email/Model/Template/Filter.php | 24 +- .../Test/Unit/Model/Template/FilterTest.php | 103 ++++- .../Magento/Persistent/Model/QuoteManager.php | 1 + .../Test/Unit/Model/QuoteManagerTest.php | 8 + ...dSameVimeoVideoForMultipleProductsTest.xml | 56 +++ .../Quote/Test/Mftf/Data/CustomerCartData.xml | 4 + .../Test/Mftf/Metadata/CustomerCartMeta.xml | 5 + .../Email/Sender/ShipmentCommentSender.php | 1 + ...nOpenOrderViewPageByOrderIdActionGroup.xml | 22 + .../AdminSalesOrderCommentsActionGroup.xml | 23 + .../StorefrontOpenMyOrdersPageActionGroup.xml | 19 + .../Test/Mftf/Data/OrderCommentsData.xml | 17 + .../AdminSalesOrderCommentsSection.xml | 16 + ...derWithCashOnDeliveryPaymentMethodTest.xml | 63 +-- ...orefrontVerifyOrderHistoryCommentsTest.xml | 74 ++++ .../Sender/ShipmentCommentSenderTest.php | 33 +- .../templates/order/order_comments.phtml | 2 +- .../Adminhtml/Promo/Quote/Generate.php | 4 + .../AdminCartPriceRulesFormSection.xml | 1 + ...cCouponTypeAndAutoGenerationTickedTest.xml | 57 +++ .../Adminhtml/Promo/Quote/GenerateTest.php | 125 +++++- app/code/Magento/SalesRule/i18n/en_US.csv | 1 + .../Sales/Total/Quote/CommonTaxCollector.php | 32 +- ...reateTaxRuleWithTwoTaxRatesActionGroup.xml | 17 + .../StorefrontCustomerOrderViewSection.xml | 13 + ...ddressAndCartWithVirtualProductTaxTest.xml | 89 ++++ .../Theme/ViewModel/Block/SessionConfig.php | 45 ++ .../Theme/view/frontend/layout/default.xml | 6 +- .../view/frontend/templates/js/cookie.phtml | 2 +- .../view/base/web/js/lib/core/collection.js | 90 +++- .../CatalogGraphQl/ProductSearchTest.php | 84 ++++ ...nfigurableProductMultipleStoreViewTest.php | 36 ++ .../Product/Attribute/Backend/SkuTest.php | 7 +- .../Catalog/Model/ProductPriceTest.php | 16 + .../Magento/Catalog/Model/ProductTest.php | 75 +++- .../ResourceModel/Product/CollectionTest.php | 49 ++- ...ple_product_with_tier_price_equal_zero.php | 34 ++ ...ct_with_tier_price_equal_zero_rollback.php | 10 + .../ProductTest/ProductMultipleStoresTest.php | 5 +- .../Import/ProductTest/ProductOptionsTest.php | 7 + .../Import/ProductTest/ProductUrlKeyTest.php | 1 + ...ct_with_children_on_different_websites.php | 95 +++++ ...hildren_on_different_websites_rollback.php | 18 + .../Model/Indexer/ReindexAllTest.php | 21 +- .../DB/DataConverter/DataConverterTest.php | 183 +++++++- lib/internal/Magento/Framework/Amqp/Queue.php | 15 +- .../Framework/Amqp/Test/Unit/QueueTest.php | 74 ++++ .../Api/AbstractSimpleObjectBuilder.php | 2 +- .../Unit/AbstractSimpleObjectBuilderTest.php | 42 ++ .../Unit/StubAbstractSimpleObjectBuilder.php | 14 + .../Interceptor.php | 12 + .../InterceptorTest.php | 44 ++ .../Framework/DB/FieldDataConverter.php | 114 ++++- .../Magento/Framework/File/Uploader.php | 3 +- pub/index.php | 1 + 80 files changed, 2332 insertions(+), 690 deletions(-) create mode 100644 app/code/Magento/Backend/Test/Mftf/Page/AdminOrderViewPage.xml create mode 100644 app/code/Magento/Catalog/Model/ResourceModel/DuplicatedProductAttributesCopier.php delete mode 100644 app/code/Magento/Catalog/Test/Unit/Model/Product/CopierTest.php delete mode 100644 app/code/Magento/CatalogRule/Model/Indexer/PartialIndex.php create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithSignInLinkForEmailVerificationTest.xml create mode 100644 app/code/Magento/ConfigurableProduct/Plugin/Model/ResourceModel/Attribute/ScopedOptionSelectBuilder.php create mode 100644 app/code/Magento/ProductVideo/Test/Mftf/Test/AdminUploadSameVimeoVideoForMultipleProductsTest.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenOrderViewPageByOrderIdActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSalesOrderCommentsActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontOpenMyOrdersPageActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Data/OrderCommentsData.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Section/AdminSalesOrderCommentsSection.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifyOrderHistoryCommentsTest.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/Test/AdminBlockCouponGeneratesUntilCartPriceRuleSavedWithSpecificCouponTypeAndAutoGenerationTickedTest.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCreateTaxRuleWithTwoTaxRatesActionGroup.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/Test/StorefrontCustomerWithDefaultBillingAddressAndCartWithVirtualProductTaxTest.xml create mode 100644 app/code/Magento/Theme/ViewModel/Block/SessionConfig.php create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/ProductSearchTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_equal_zero.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_equal_zero_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/configurable_product_with_children_on_different_websites.php create mode 100644 dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/configurable_product_with_children_on_different_websites_rollback.php create mode 100644 lib/internal/Magento/Framework/Amqp/Test/Unit/QueueTest.php create mode 100644 lib/internal/Magento/Framework/Api/Test/Unit/AbstractSimpleObjectBuilderTest.php create mode 100644 lib/internal/Magento/Framework/Api/Test/Unit/StubAbstractSimpleObjectBuilder.php create mode 100644 lib/internal/Magento/Framework/Api/Test/Unit/StubAbstractSimpleObjectBuilder/Interceptor.php create mode 100644 lib/internal/Magento/Framework/Api/Test/Unit/StubAbstractSimpleObjectBuilder/InterceptorTest.php diff --git a/app/code/Magento/Backend/Block/Store/Switcher.php b/app/code/Magento/Backend/Block/Store/Switcher.php index 2ae929f9b7398..76b6c54fdae50 100644 --- a/app/code/Magento/Backend/Block/Store/Switcher.php +++ b/app/code/Magento/Backend/Block/Store/Switcher.php @@ -7,6 +7,8 @@ namespace Magento\Backend\Block\Store; +use Magento\Framework\Exception\LocalizedException; + /** * Store switcher block * @@ -471,9 +473,17 @@ public function getCurrentSelectionName() */ public function getCurrentWebsiteName() { - if ($this->getWebsiteId() !== null) { + $websiteId = $this->getWebsiteId(); + if ($websiteId !== null) { + if ($this->hasData('get_data_from_request')) { + $requestedWebsite = $this->getRequest()->getParams('website'); + if (!empty($requestedWebsite) + && array_key_exists('website', $requestedWebsite)) { + $websiteId = $requestedWebsite['website']; + } + } $website = $this->_websiteFactory->create(); - $website->load($this->getWebsiteId()); + $website->load($websiteId); if ($website->getId()) { return $website->getName(); } @@ -504,12 +514,21 @@ public function getCurrentStoreGroupName() * Get current store view name * * @return string + * @throws LocalizedException */ public function getCurrentStoreName() { - if ($this->getStoreId() !== null) { + $storeId = $this->getStoreId(); + if ($storeId !== null) { + if ($this->hasData('get_data_from_request')) { + $requestedStore = $this->getRequest()->getParams('store'); + if (!empty($requestedStore) + && array_key_exists('store', $requestedStore)) { + $storeId = $requestedStore['store']; + } + } $store = $this->_storeFactory->create(); - $store->load($this->getStoreId()); + $store->load($storeId); if ($store->getId()) { return $store->getName(); } diff --git a/app/code/Magento/Backend/Test/Mftf/Page/AdminOrderViewPage.xml b/app/code/Magento/Backend/Test/Mftf/Page/AdminOrderViewPage.xml new file mode 100644 index 0000000000000..cfdb99ee36251 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Page/AdminOrderViewPage.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> + <page name="AdminOrderViewPage" url="sales/order/view/order_id/{{entity_id}}" area="admin" module="Backend"/> +</pages> diff --git a/app/code/Magento/Backend/Test/Unit/Block/Store/SwitcherTest.php b/app/code/Magento/Backend/Test/Unit/Block/Store/SwitcherTest.php index 42b7254d8f3da..85f4709994e2a 100644 --- a/app/code/Magento/Backend/Test/Unit/Block/Store/SwitcherTest.php +++ b/app/code/Magento/Backend/Test/Unit/Block/Store/SwitcherTest.php @@ -8,10 +8,15 @@ namespace Magento\Backend\Test\Unit\Block\Store; use Magento\Backend\Block\Store\Switcher; +use Magento\Framework\App\RequestInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Store\Model\StoreFactory; +use Magento\Store\Model\Store; +use Magento\Store\Model\WebsiteFactory; +use Magento\Store\Model\Website; use Magento\Backend\Block\Template\Context; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Store\Model\StoreManagerInterface; -use Magento\Store\Model\Website; use PHPUnit\Framework\TestCase; class SwitcherTest extends TestCase @@ -23,20 +28,81 @@ class SwitcherTest extends TestCase private $storeManagerMock; + /** + * @var RequestInterface|MockObject + */ + private $requestMock; + + /** + * @var WebsiteFactory|MockObject + */ + private $websiteFactoryMock; + + /** + * @var StoreFactory|MockObject + */ + private $storeFactoryMock; + + /** + * @var Website|MockObject + */ + private $websiteMock; + + /** + * @var Store|MockObject + */ + private $storeMock; + protected function setUp(): void { $this->storeManagerMock = $this->getMockForAbstractClass(StoreManagerInterface::class); $objectHelper = new ObjectManager($this); + $this->requestMock = $this->getMockBuilder(RequestInterface::class) + ->getMockForAbstractClass(); + $this->websiteFactoryMock = $this->getMockBuilder(WebsiteFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->storeFactoryMock = $this->getMockBuilder(StoreFactory::class) + ->disableOriginalConstructor() + ->setMethods(['create']) + ->getMock(); + $this->websiteMock = $this->getMockBuilder(Website::class) + ->disableOriginalConstructor() + ->setMethods(['load', 'getId', 'getName']) + ->getMock(); + $this->storeMock = $this->getMockBuilder(Store::class) + ->disableOriginalConstructor() + ->setMethods(['load', 'getId', 'getName']) + ->getMock(); + $this->websiteFactoryMock->expects($this->any()) + ->method('create') + ->willReturn($this->websiteMock); + $this->storeFactoryMock->expects($this->any()) + ->method('create') + ->willReturn($this->storeMock); + $this->websiteMock->expects($this->any()) + ->method('load') + ->willReturnSelf(); + $this->storeMock->expects($this->any()) + ->method('load') + ->willReturnSelf(); $context = $objectHelper->getObject( Context::class, [ 'storeManager' => $this->storeManagerMock, + 'request' => $this->requestMock ] ); $this->switcherBlock = $objectHelper->getObject( Switcher::class, - ['context' => $context] + [ + 'context' => $context, + 'data' => ['get_data_from_request' => 1], + 'websiteFactory' => $this->websiteFactoryMock, + 'storeFactory' => $this->storeFactoryMock + ] ); } @@ -58,4 +124,91 @@ public function testGetWebsitesIfSetWebsiteIds() $expected = [1 => $websiteMock]; $this->assertEquals($expected, $this->switcherBlock->getWebsites()); } + + /** + * Test case for after current store name plugin + * + * @param array $requestedStore + * @param string $expectedResult + * @return void + * @dataProvider getStoreNameDataProvider + * @throws LocalizedException + */ + public function testAfterGetCurrentStoreName(array $requestedStore, string $expectedResult): void + { + $this->requestMock->expects($this->any()) + ->method('getParams') + ->willReturn($requestedStore); + $this->storeMock->expects($this->any()) + ->method('getId') + ->willReturn($requestedStore); + $this->storeMock->expects($this->any()) + ->method('getName') + ->willReturn($expectedResult); + $this->assertSame($expectedResult, $this->switcherBlock->getCurrentStoreName()); + } + + /** + * Data provider for getStoreName plugin + * + * @return array + */ + public function getStoreNameDataProvider(): array + { + return [ + 'test storeName with valid requested store' => + [ + ['store' => 'test store'], + 'base store' + ], + 'test storeName with invalid requested store' => + [ + ['store' => 'test store'], + 'test store' + ] + ]; + } + + /** + * Test case for get current website name + * + * @param array $requestedWebsite + * @param string $expectedResult + * @return void + * @dataProvider getWebsiteNameDataProvider + */ + public function testGetCurrentWebsiteName(array $requestedWebsite, string $expectedResult): void + { + $this->requestMock->expects($this->any()) + ->method('getParams') + ->willReturn($requestedWebsite); + $this->websiteMock->expects($this->any()) + ->method('getId') + ->willReturn($requestedWebsite); + $this->websiteMock->expects($this->any()) + ->method('getName') + ->willReturn($expectedResult); + $this->assertSame($expectedResult, $this->switcherBlock->getCurrentWebsiteName()); + } + + /** + * Data provider for getWebsiteName plugin + * + * @return array + */ + public function getWebsiteNameDataProvider(): array + { + return [ + 'test websiteName with valid requested website' => + [ + ['website' => 'test website'], + 'base website' + ], + 'test websiteName with invalid requested website' => + [ + ['website' => 'test website'], + 'test website' + ] + ]; + } } diff --git a/app/code/Magento/Catalog/Model/Product/Copier.php b/app/code/Magento/Catalog/Model/Product/Copier.php index b04d3da8f0223..0ce40d0523c73 100644 --- a/app/code/Magento/Catalog/Model/Product/Copier.php +++ b/app/code/Magento/Catalog/Model/Product/Copier.php @@ -6,12 +6,13 @@ namespace Magento\Catalog\Model\Product; use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Attribute\ScopeOverriddenValue; use Magento\Catalog\Model\Product; use Magento\Catalog\Model\Product\Attribute\Source\Status; use Magento\Catalog\Model\Product\Option\Repository as OptionRepository; use Magento\Catalog\Model\ProductFactory; -use Magento\Framework\App\ObjectManager; +use Magento\Catalog\Model\ResourceModel\DuplicatedProductAttributesCopier; use Magento\Framework\EntityManager\MetadataPool; use Magento\Store\Model\Store; use Magento\UrlRewrite\Model\Exception\UrlAlreadyExistsException; @@ -50,25 +51,41 @@ class Copier */ private $scopeOverriddenValue; + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @var DuplicatedProductAttributesCopier + */ + private $attributeCopier; + /** * @param CopyConstructorInterface $copyConstructor * @param ProductFactory $productFactory * @param ScopeOverriddenValue $scopeOverriddenValue * @param OptionRepository|null $optionRepository * @param MetadataPool|null $metadataPool + * @param ProductRepositoryInterface $productRepository + * @param DuplicatedProductAttributesCopier $attributeCopier */ public function __construct( CopyConstructorInterface $copyConstructor, ProductFactory $productFactory, ScopeOverriddenValue $scopeOverriddenValue, OptionRepository $optionRepository, - MetadataPool $metadataPool + MetadataPool $metadataPool, + ProductRepositoryInterface $productRepository, + DuplicatedProductAttributesCopier $attributeCopier ) { $this->productFactory = $productFactory; $this->copyConstructor = $copyConstructor; $this->scopeOverriddenValue = $scopeOverriddenValue; $this->optionRepository = $optionRepository; $this->metadataPool = $metadataPool; + $this->productRepository = $productRepository; + $this->attributeCopier = $attributeCopier; } /** @@ -79,11 +96,13 @@ public function __construct( */ public function copy(Product $product): Product { - $product->getWebsiteIds(); - $product->getCategoryIds(); - $metadata = $this->metadataPool->getMetadata(ProductInterface::class); + /* Regardless in what scope the product was provided, + for duplicating we want to clone product in Global scope first */ + if ((int)$product->getStoreId() !== Store::DEFAULT_STORE_ID) { + $product = $this->productRepository->getById($product->getId(), true, Store::DEFAULT_STORE_ID); + } /** @var Product $duplicate */ $duplicate = $this->productFactory->create(); $productData = $product->getData(); @@ -102,6 +121,7 @@ public function copy(Product $product): Product $duplicate->setStoreId(Store::DEFAULT_STORE_ID); $this->copyConstructor->build($product, $duplicate); $this->setDefaultUrl($product, $duplicate); + $this->attributeCopier->copyProductAttributes($product, $duplicate); $this->setStoresUrl($product, $duplicate); $this->optionRepository->duplicate($product, $duplicate); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/DuplicatedProductAttributesCopier.php b/app/code/Magento/Catalog/Model/ResourceModel/DuplicatedProductAttributesCopier.php new file mode 100644 index 0000000000000..5c46b379cda32 --- /dev/null +++ b/app/code/Magento/Catalog/Model/ResourceModel/DuplicatedProductAttributesCopier.php @@ -0,0 +1,99 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\ResourceModel; + +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\Store\Model\Store; + +/** + * DuplicatedProductAttributesCopier + * + * Is used to copy product attributes related to non-global scope + * from source to target product during product duplication + */ +class DuplicatedProductAttributesCopier +{ + /** + * @var MetadataPool + */ + private $metadataPool; + + /** + * @var CollectionFactory + */ + private $collectionFactory; + + /** + * @var ResourceConnection + */ + private $resource; + + /** + * @param MetadataPool $metadataPool + * @param CollectionFactory $collectionFactory + * @param ResourceConnection $resource + */ + public function __construct( + MetadataPool $metadataPool, + CollectionFactory $collectionFactory, + ResourceConnection $resource + ) { + $this->metadataPool = $metadataPool; + $this->collectionFactory = $collectionFactory; + $this->resource = $resource; + } + + /** + * Copy non-global Product Attributes form source to target + * + * @param $source Product + * @param $target Product + * @return void + */ + public function copyProductAttributes(Product $source, Product $target): void + { + $metadata = $this->metadataPool->getMetadata(ProductInterface::class); + $linkField = $metadata->getLinkField(); + $attributeCollection = $this->collectionFactory->create() + ->setAttributeSetFilter($source->getAttributeSetId()) + ->addFieldToFilter('backend_type', ['neq' => 'static']) + ->addFieldToFilter('is_global', 0); + + $eavTableNames = []; + foreach ($attributeCollection->getItems() as $item) { + /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $item */ + $eavTableNames[] = $item->getBackendTable(); + } + + $connection = $this->resource->getConnection(); + foreach (array_unique($eavTableNames) as $eavTable) { + $select = $connection->select() + ->from( + ['main_table' => $this->resource->getTableName($eavTable)], + ['attribute_id', 'store_id', 'value'] + )->where($linkField . ' = ?', $source->getData($linkField)) + ->where('store_id <> ?', Store::DEFAULT_STORE_ID); + $records = $connection->fetchAll($select); + + if (!count($records)) { + continue; + } + + foreach ($records as $index => $bind) { + $bind[$linkField] = $target->getData($linkField); + $records[$index] = $bind; + } + + $connection->insertMultiple($this->resource->getTableName($eavTable), $records); + } + } +} diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php index a247e6b09760b..246192fdc7bd5 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php @@ -1767,9 +1767,7 @@ public function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC) if ($attribute == 'price' && $storeId != 0) { $this->addPriceData(); if ($this->_productLimitationFilters->isUsingPriceIndex()) { - $this->getSelect()->order( - new \Zend_Db_Expr("price_index.min_price = 0, price_index.min_price {$dir}") - ); + $this->getSelect()->order("price_index.min_price {$dir}"); return $this; } } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php index be1d1637b8532..f78dbcb14c3f4 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/Query/BaseFinalPrice.php @@ -305,7 +305,7 @@ private function getTotalTierPriceExpression(\Zend_Db_Expr $priceExpression) private function getTierPriceExpressionForTable($tableAlias, \Zend_Db_Expr $priceExpression): \Zend_Db_Expr { return $this->getConnection()->getCheckSql( - sprintf('%s.value = 0', $tableAlias), + sprintf('%s.percentage_value IS NOT NULL', $tableAlias), sprintf( 'ROUND(%s * (1 - ROUND(%s.percentage_value * cwd.rate, 4) / 100), 4)', $priceExpression, diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/CopierTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/CopierTest.php deleted file mode 100644 index d3a4494c071b7..0000000000000 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/CopierTest.php +++ /dev/null @@ -1,394 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\Catalog\Test\Unit\Model\Product; - -use Magento\Catalog\Api\Data\ProductExtensionInterface; -use Magento\Catalog\Api\Data\ProductInterface; -use Magento\Catalog\Model\Attribute\ScopeOverriddenValue; -use Magento\Catalog\Model\Product; -use Magento\Catalog\Model\Product\Attribute\Source\Status; -use Magento\Catalog\Model\Product\Copier; -use Magento\Catalog\Model\Product\CopyConstructorInterface; -use Magento\Catalog\Model\Product\Option\Repository; -use Magento\Catalog\Model\ProductFactory; -use Magento\Catalog\Model\ResourceModel\Product as ProductResourceModel; -use Magento\CatalogInventory\Api\Data\StockItemInterface; -use Magento\Eav\Model\Entity\AbstractEntity; -use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; -use Magento\Framework\EntityManager\EntityMetadata; -use Magento\Framework\EntityManager\MetadataPool; -use Magento\UrlRewrite\Model\Exception\UrlAlreadyExistsException; -use PHPUnit\Framework\MockObject\MockObject; -use PHPUnit\Framework\TestCase; - -/** - * Test for Magento\Catalog\Model\Product\Copier class. - * - * @SuppressWarnings(PHPMD.CouplingBetweenObjects) - */ -class CopierTest extends TestCase -{ - /** - * @var Copier - */ - private $_model; - - /** - * @var Repository|MockObject - */ - private $optionRepositoryMock; - - /** - * @var CopyConstructorInterface|MockObject - */ - private $copyConstructorMock; - - /** - * @var ProductFactory|MockObject - */ - private $productFactoryMock; - - /** - * @var ScopeOverriddenValue|MockObject - */ - private $scopeOverriddenValueMock; - - /** - * @var Product|MockObject - */ - private $productMock; - - /** - * @var EntityMetadata|MockObject - */ - private $metadata; - - /** - * @ingeritdoc - */ - protected function setUp(): void - { - $this->copyConstructorMock = $this->getMockForAbstractClass(CopyConstructorInterface::class); - $this->productFactoryMock = $this->createPartialMock(ProductFactory::class, ['create']); - $this->scopeOverriddenValueMock = $this->createMock(ScopeOverriddenValue::class); - $this->optionRepositoryMock = $this->createMock(Repository::class); - $this->productMock = $this->createMock(Product::class); - - $this->metadata = $this->getMockBuilder(EntityMetadata::class) - ->disableOriginalConstructor() - ->getMock(); - - /** @var MetadataPool|MockObject $metadataPool */ - $metadataPool = $this->getMockBuilder(MetadataPool::class) - ->disableOriginalConstructor() - ->getMock(); - $metadataPool->expects($this->once()) - ->method('getMetadata') - ->willReturn($this->metadata); - $this->_model = new Copier( - $this->copyConstructorMock, - $this->productFactoryMock, - $this->scopeOverriddenValueMock, - $this->optionRepositoryMock, - $metadataPool - ); - } - - /** - * Test duplicate product - * - * @return void - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function testCopy(): void - { - $stockItem = $this->getMockForAbstractClass(StockItemInterface::class); - $extensionAttributes = $this->getMockBuilder(ProductExtensionInterface::class) - ->setMethods(['getStockItem', 'setData']) - ->getMockForAbstractClass(); - $extensionAttributes - ->expects($this->once()) - ->method('getStockItem') - ->willReturn($stockItem); - $extensionAttributes - ->expects($this->once()) - ->method('setData') - ->with('stock_item', null); - - $productData = [ - 'product data' => ['product data'], - ProductInterface::EXTENSION_ATTRIBUTES_KEY => $extensionAttributes, - ]; - $this->productMock->expects($this->atLeastOnce()) - ->method('getWebsiteIds'); - $this->productMock->expects($this->atLeastOnce()) - ->method('getCategoryIds'); - $this->productMock->expects($this->exactly(2)) - ->method('getData') - ->willReturnMap([ - ['', null, $productData], - ['linkField', null, '1'], - ]); - - $entityMock = $this->getMockForAbstractClass( - AbstractEntity::class, - [], - '', - false, - true, - true, - ['checkAttributeUniqueValue'] - ); - $entityMock->expects($this->once()) - ->method('checkAttributeUniqueValue') - ->willReturn(true); - - $attributeMock = $this->getMockForAbstractClass( - AbstractAttribute::class, - [], - '', - false, - true, - true, - ['getEntity'] - ); - $attributeMock->expects($this->once()) - ->method('getEntity') - ->willReturn($entityMock); - - $resourceMock = $this->getMockBuilder(ProductResourceModel::class) - ->disableOriginalConstructor() - ->setMethods(['getAttributeRawValue', 'duplicate', 'getAttribute']) - ->getMock(); - $resourceMock->expects($this->once()) - ->method('getAttributeRawValue') - ->willReturn('urk-key-1'); - $resourceMock->expects($this->exactly(2)) - ->method('getAttribute') - ->willReturn($attributeMock); - - $this->productMock->expects($this->exactly(2)) - ->method('getResource') - ->willReturn($resourceMock); - - $duplicateMock = $this->getMockBuilder(Product::class) - ->addMethods( - [ - 'setIsDuplicate', - 'setOriginalLinkId', - 'setUrlKey', - 'setMetaTitle', - 'setMetaKeyword', - 'setMetaDescription' - ] - ) - ->onlyMethods( - [ - 'setData', - 'setOptions', - 'getData', - 'setStatus', - 'setCreatedAt', - 'setUpdatedAt', - 'setId', - 'getEntityId', - 'save', - 'setStoreId', - 'getStoreIds' - ] - ) - ->disableOriginalConstructor() - ->getMock(); - $this->productFactoryMock->expects($this->once()) - ->method('create') - ->willReturn($duplicateMock); - - $duplicateMock->expects($this->once())->method('setOptions')->with([]); - $duplicateMock->expects($this->once())->method('setIsDuplicate')->with(true); - $duplicateMock->expects($this->once())->method('setOriginalLinkId')->with(1); - $duplicateMock->expects($this->once()) - ->method('setStatus') - ->with(Status::STATUS_DISABLED); - $duplicateMock->expects($this->atLeastOnce())->method('setStoreId'); - $duplicateMock->expects($this->once()) - ->method('setCreatedAt') - ->with(null); - $duplicateMock->expects($this->once()) - ->method('setUpdatedAt') - ->with(null); - $duplicateMock->expects($this->once()) - ->method('setId') - ->with(null); - $duplicateMock->expects($this->once()) - ->method('setMetaTitle') - ->with(null); - $duplicateMock->expects($this->once()) - ->method('setMetaKeyword') - ->with(null); - $duplicateMock->expects($this->once()) - ->method('setMetaDescription') - ->with(null); - $duplicateMock->expects($this->atLeastOnce()) - ->method('getStoreIds')->willReturn([]); - $duplicateMock->expects($this->atLeastOnce()) - ->method('setData') - ->willReturn($duplicateMock); - $this->copyConstructorMock->expects($this->once()) - ->method('build') - ->with($this->productMock, $duplicateMock); - $duplicateMock->expects($this->once()) - ->method('setUrlKey') - ->with('urk-key-2') - ->willReturn($duplicateMock); - $duplicateMock->expects($this->once()) - ->method('save'); - $this->metadata->expects($this->once()) - ->method('getLinkField') - ->willReturn('linkField'); - $duplicateMock->expects($this->never()) - ->method('getData'); - $this->optionRepositoryMock->expects($this->once()) - ->method('duplicate') - ->with($this->productMock, $duplicateMock); - - $this->assertEquals($duplicateMock, $this->_model->copy($this->productMock)); - } - - /** - * Test duplicate product with `UrlAlreadyExistsException` while copy stores url - * - * @return void - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function testUrlAlreadyExistsExceptionWhileCopyStoresUrl(): void - { - $stockItem = $this->getMockBuilder(StockItemInterface::class) - ->getMock(); - $extensionAttributes = $this->getMockBuilder(ProductExtensionInterface::class) - ->setMethods(['getStockItem', 'setData']) - ->getMockForAbstractClass(); - $extensionAttributes - ->expects($this->once()) - ->method('getStockItem') - ->willReturn($stockItem); - $extensionAttributes - ->expects($this->once()) - ->method('setData') - ->with('stock_item', null); - - $productData = [ - 'product data' => ['product data'], - ProductInterface::EXTENSION_ATTRIBUTES_KEY => $extensionAttributes, - ]; - $this->productMock->expects($this->atLeastOnce())->method('getWebsiteIds'); - $this->productMock->expects($this->atLeastOnce())->method('getCategoryIds'); - $this->productMock->expects($this->any())->method('getData')->willReturnMap([ - ['', null, $productData], - ['linkField', null, '1'], - ]); - - $entityMock = $this->getMockForAbstractClass( - AbstractEntity::class, - [], - '', - false, - true, - true, - ['checkAttributeUniqueValue'] - ); - $entityMock->expects($this->exactly(11)) - ->method('checkAttributeUniqueValue') - ->willReturn(true, false); - - $attributeMock = $this->getMockForAbstractClass( - AbstractAttribute::class, - [], - '', - false, - true, - true, - ['getEntity'] - ); - $attributeMock->expects($this->any()) - ->method('getEntity') - ->willReturn($entityMock); - - $resourceMock = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Product::class) - ->disableOriginalConstructor() - ->setMethods(['getAttributeRawValue', 'duplicate', 'getAttribute']) - ->getMock(); - $resourceMock->expects($this->any()) - ->method('getAttributeRawValue') - ->willReturn('urk-key-1'); - $resourceMock->expects($this->any()) - ->method('getAttribute') - ->willReturn($attributeMock); - - $this->productMock->expects($this->any())->method('getResource')->willReturn($resourceMock); - - $duplicateMock = $this->getMockBuilder(Product::class) - ->addMethods(['setIsDuplicate', 'setOriginalLinkId', 'setUrlKey']) - ->onlyMethods( - [ - 'setData', - 'setOptions', - 'getData', - 'setStatus', - 'setCreatedAt', - 'setUpdatedAt', - 'setId', - 'getEntityId', - 'save', - 'setStoreId', - 'getStoreIds' - ] - ) - ->disableOriginalConstructor() - ->getMock(); - $this->productFactoryMock->expects($this->once())->method('create')->willReturn($duplicateMock); - - $duplicateMock->expects($this->once())->method('setOptions')->with([]); - $duplicateMock->expects($this->once())->method('setIsDuplicate')->with(true); - $duplicateMock->expects($this->once())->method('setOriginalLinkId')->with(1); - $duplicateMock->expects( - $this->once() - )->method( - 'setStatus' - )->with( - Status::STATUS_DISABLED - ); - $duplicateMock->expects($this->atLeastOnce())->method('setStoreId'); - $duplicateMock->expects($this->once())->method('setCreatedAt')->with(null); - $duplicateMock->expects($this->once())->method('setUpdatedAt')->with(null); - $duplicateMock->expects($this->once())->method('setId')->with(null); - $duplicateMock->expects($this->atLeastOnce())->method('getStoreIds')->willReturn([1]); - $duplicateMock->expects($this->atLeastOnce())->method('setData')->willReturn($duplicateMock); - $this->copyConstructorMock->expects($this->once())->method('build')->with($this->productMock, $duplicateMock); - $duplicateMock->expects( - $this->exactly(11) - )->method( - 'setUrlKey' - )->with( - $this->stringContains('urk-key-') - )->willReturn( - $duplicateMock - ); - $duplicateMock->expects($this->once())->method('save'); - - $this->scopeOverriddenValueMock->expects($this->once())->method('containsValue')->willReturn(true); - - $this->metadata->expects($this->any())->method('getLinkField')->willReturn('linkField'); - - $duplicateMock->expects($this->any())->method('getData')->willReturnMap([ - ['linkField', null, '2'], - ]); - - $this->expectException(UrlAlreadyExistsException::class); - $this->_model->copy($this->productMock); - } -} diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ProductSearch.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ProductSearch.php index 13bd29e83d87f..dd82bf277a33a 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ProductSearch.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/ProductSearch.php @@ -8,6 +8,7 @@ namespace Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider; use Magento\Catalog\Api\Data\ProductSearchResultsInterfaceFactory; +use Magento\Catalog\Model\Product\Visibility; use Magento\Catalog\Model\ResourceModel\Product\Collection; use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionPostProcessor; @@ -18,6 +19,7 @@ use Magento\Framework\Api\Search\SearchResultInterface; use Magento\Framework\Api\SearchCriteriaInterface; use Magento\Framework\Api\SearchResultsInterface; +use Magento\Framework\App\ObjectManager; use Magento\GraphQl\Model\Query\ContextInterface; /** @@ -55,6 +57,11 @@ class ProductSearch */ private $searchCriteriaBuilder; + /** + * @var Visibility + */ + private $catalogProductVisibility; + /** * @param CollectionFactory $collectionFactory * @param ProductSearchResultsInterfaceFactory $searchResultsFactory @@ -62,6 +69,7 @@ class ProductSearch * @param CollectionPostProcessor $collectionPostProcessor * @param SearchResultApplierFactory $searchResultsApplierFactory * @param ProductCollectionSearchCriteriaBuilder $searchCriteriaBuilder + * @param Visibility $catalogProductVisibility */ public function __construct( CollectionFactory $collectionFactory, @@ -69,7 +77,8 @@ public function __construct( CollectionProcessorInterface $collectionPreProcessor, CollectionPostProcessor $collectionPostProcessor, SearchResultApplierFactory $searchResultsApplierFactory, - ProductCollectionSearchCriteriaBuilder $searchCriteriaBuilder + ProductCollectionSearchCriteriaBuilder $searchCriteriaBuilder, + Visibility $catalogProductVisibility ) { $this->collectionFactory = $collectionFactory; $this->searchResultsFactory = $searchResultsFactory; @@ -77,6 +86,7 @@ public function __construct( $this->collectionPostProcessor = $collectionPostProcessor; $this->searchResultApplierFactory = $searchResultsApplierFactory; $this->searchCriteriaBuilder = $searchCriteriaBuilder; + $this->catalogProductVisibility = $catalogProductVisibility; } /** @@ -106,6 +116,7 @@ public function getList( $this->getSortOrderArray($searchCriteriaForCollection) )->apply(); + $collection->setVisibility($this->catalogProductVisibility->getVisibleInSiteIds()); $this->collectionPreProcessor->process($collection, $searchCriteriaForCollection, $attributes, $context); $collection->load(); $this->collectionPostProcessor->process($collection, $attributes); diff --git a/app/code/Magento/CatalogRule/Cron/DailyCatalogUpdate.php b/app/code/Magento/CatalogRule/Cron/DailyCatalogUpdate.php index 116a4529a8e60..f659df2ee0ecd 100644 --- a/app/code/Magento/CatalogRule/Cron/DailyCatalogUpdate.php +++ b/app/code/Magento/CatalogRule/Cron/DailyCatalogUpdate.php @@ -6,8 +6,8 @@ namespace Magento\CatalogRule\Cron; -use Magento\CatalogRule\Model\Indexer\PartialIndex; use Magento\CatalogRule\Model\Indexer\Rule\RuleProductProcessor; +use Magento\CatalogRule\Model\ResourceModel\Rule\CollectionFactory as RuleCollectionFactory; /** * Daily update catalog price rule by cron @@ -20,24 +20,25 @@ class DailyCatalogUpdate protected $ruleProductProcessor; /** - * @var PartialIndex + * @var RuleCollectionFactory */ - private $partialIndex; + private $ruleCollectionFactory; /** * @param RuleProductProcessor $ruleProductProcessor - * @param PartialIndex $partialIndex + * @param RuleCollectionFactory $ruleCollectionFactory */ public function __construct( RuleProductProcessor $ruleProductProcessor, - PartialIndex $partialIndex + RuleCollectionFactory $ruleCollectionFactory ) { $this->ruleProductProcessor = $ruleProductProcessor; - $this->partialIndex = $partialIndex; + $this->ruleCollectionFactory = $ruleCollectionFactory; } /** * Daily update catalog price rule by cron + * * Update include interval 3 days - current day - 1 days before + 1 days after * This method is called from cron process, cron is working in UTC time and * we should generate data for interval -1 day ... +1 day @@ -46,8 +47,10 @@ public function __construct( */ public function execute() { - $this->ruleProductProcessor->isIndexerScheduled() - ? $this->partialIndex->partialUpdateCatalogRuleProductPrice() - : $this->ruleProductProcessor->markIndexerAsInvalid(); + $ruleCollection = $this->ruleCollectionFactory->create(); + $ruleCollection->addIsActiveFilter(); + if ($ruleCollection->getSize()) { + $this->ruleProductProcessor->markIndexerAsInvalid(); + } } } diff --git a/app/code/Magento/CatalogRule/Model/Indexer/PartialIndex.php b/app/code/Magento/CatalogRule/Model/Indexer/PartialIndex.php deleted file mode 100644 index 12a77f81826d6..0000000000000 --- a/app/code/Magento/CatalogRule/Model/Indexer/PartialIndex.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -declare(strict_types=1); - -namespace Magento\CatalogRule\Model\Indexer; - -use Magento\Framework\DB\Adapter\AdapterInterface; -use Magento\Framework\App\ResourceConnection; - -/** - * Catalog rule partial index - * - * This class triggers the dependent index "catalog_product_price", - * and the cache is cleared only for the matched products for partial indexing. - */ -class PartialIndex -{ - /** - * @var ResourceConnection - */ - private $resource; - - /** - * @var AdapterInterface - */ - private $connection; - - /** - * @var IndexBuilder - */ - private $indexBuilder; - - /** - * @param ResourceConnection $resource - * @param IndexBuilder $indexBuilder - */ - public function __construct( - ResourceConnection $resource, - IndexBuilder $indexBuilder - ) { - $this->resource = $resource; - $this->connection = $resource->getConnection(); - $this->indexBuilder = $indexBuilder; - } - - /** - * Synchronization replica table with original table "catalogrule_product_price" - * - * Used replica table for correctly working MySQL trigger - * - * @return void - */ - public function partialUpdateCatalogRuleProductPrice(): void - { - $this->indexBuilder->reindexFull(); - $indexTableName = $this->resource->getTableName('catalogrule_product_price'); - $select = $this->connection->select()->from( - ['crp' => $indexTableName], - 'product_id' - ); - $selectFields = $this->connection->select()->from( - ['crp' => $indexTableName], - [ - 'rule_date', - 'customer_group_id', - 'product_id', - 'rule_price', - 'website_id', - 'latest_start_date', - 'earliest_end_date', - ] - ); - $where = ['product_id' .' NOT IN (?)' => $select]; - //remove products that are no longer used in indexing - $this->connection->delete($this->resource->getTableName('catalogrule_product_price_replica'), $where); - //add updated products to indexing - $this->connection->query( - $this->connection->insertFromSelect( - $selectFields, - $this->resource->getTableName('catalogrule_product_price_replica'), - [ - 'rule_date', - 'customer_group_id', - 'product_id', - 'rule_price', - 'website_id', - 'latest_start_date', - 'earliest_end_date', - ], - AdapterInterface::INSERT_ON_DUPLICATE - ) - ); - } -} diff --git a/app/code/Magento/CatalogRule/Test/Unit/Cron/DailyCatalogUpdateTest.php b/app/code/Magento/CatalogRule/Test/Unit/Cron/DailyCatalogUpdateTest.php index c3e596ca4961d..e1dd10f921155 100644 --- a/app/code/Magento/CatalogRule/Test/Unit/Cron/DailyCatalogUpdateTest.php +++ b/app/code/Magento/CatalogRule/Test/Unit/Cron/DailyCatalogUpdateTest.php @@ -5,49 +5,71 @@ */ declare(strict_types=1); - namespace Magento\CatalogRule\Test\Unit\Cron; use Magento\CatalogRule\Cron\DailyCatalogUpdate; use Magento\CatalogRule\Model\Indexer\Rule\RuleProductProcessor; -use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; +use Magento\CatalogRule\Model\ResourceModel\Rule\Collection as RuleCollection; +use Magento\CatalogRule\Model\ResourceModel\Rule\CollectionFactory as RuleCollectionFactory; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; class DailyCatalogUpdateTest extends TestCase { /** - * Processor - * * @var RuleProductProcessor|MockObject */ - protected $ruleProductProcessor; + private $ruleProductProcessor; + + /** + * @var RuleCollectionFactory|MockObject + */ + private $ruleCollectionFactory; /** - * Cron object - * * @var DailyCatalogUpdate */ - protected $cron; + private $cron; protected function setUp(): void { - $this->ruleProductProcessor = $this->createMock( - RuleProductProcessor::class - ); - - $this->cron = (new ObjectManager($this))->getObject( - DailyCatalogUpdate::class, - [ - 'ruleProductProcessor' => $this->ruleProductProcessor, - ] - ); + $this->ruleProductProcessor = $this->createMock(RuleProductProcessor::class); + $this->ruleCollectionFactory = $this->createMock(RuleCollectionFactory::class); + + $this->cron = new DailyCatalogUpdate($this->ruleProductProcessor, $this->ruleCollectionFactory); } - public function testDailyCatalogUpdate() + /** + * @dataProvider executeDataProvider + * @param int $activeRulesCount + * @param bool $isInvalidationNeeded + */ + public function testExecute(int $activeRulesCount, bool $isInvalidationNeeded) { - $this->ruleProductProcessor->expects($this->once())->method('markIndexerAsInvalid'); + $ruleCollection = $this->createMock(RuleCollection::class); + $this->ruleCollectionFactory->expects($this->once()) + ->method('create') + ->willReturn($ruleCollection); + $ruleCollection->expects($this->once()) + ->method('addIsActiveFilter') + ->willReturn($ruleCollection); + $ruleCollection->expects($this->once()) + ->method('getSize') + ->willReturn($activeRulesCount); + $this->ruleProductProcessor->expects($isInvalidationNeeded ? $this->once() : $this->never()) + ->method('markIndexerAsInvalid'); $this->cron->execute(); } + + /** + * @return array + */ + public function executeDataProvider(): array + { + return [ + [2, true], + [0, false], + ]; + } } diff --git a/app/code/Magento/CatalogRule/etc/mview.xml b/app/code/Magento/CatalogRule/etc/mview.xml index 106e0ffabb2b2..daba451c79374 100644 --- a/app/code/Magento/CatalogRule/etc/mview.xml +++ b/app/code/Magento/CatalogRule/etc/mview.xml @@ -27,7 +27,6 @@ <view id="catalog_product_price" class="Magento\Catalog\Model\Indexer\Product\Price" group="indexer"> <subscriptions> <table name="catalogrule_product_price" entity_column="product_id" /> - <table name="catalogrule_product_price_replica" entity_column="product_id" /> </subscriptions> </view> </config> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithSignInLinkForEmailVerificationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithSignInLinkForEmailVerificationTest.xml new file mode 100644 index 0000000000000..2e1c8d5a27886 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/OnePageCheckoutWithSignInLinkForEmailVerificationTest.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="OnePageCheckoutWithSignInLinkForEmailVerificationTest"> + <annotations> + <features value="OnePageCheckout"/> + <title value="OnePageCheckout with sign in link for email verification test"/> + <description value="Verify that error message is correct for invalid a email entered with 'Sign in' form"/> + <stories value="Inconsistent customer email validation on frontend"/> + <severity value="MINOR"/> + <testCaseId value="MC-42729"/> + <group value="checkout"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <!-- Create Simple Product --> + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"> + <field key="price">560</field> + </createData> + </before> + <after> + <!-- Delete created product --> + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> + </after> + + <!-- Add Simple Product to cart --> + <amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> + <waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> + <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> + <argument name="productName" value="$$createSimpleProduct.name$$"/> + </actionGroup> + + <!-- Go to shopping cart --> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> + <actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="clickProceedToCheckout"/> + <comment userInput="Adding the comment to replace waitForProceedToCheckout action for preserving Backward Compatibility" stepKey="waitForProceedToCheckout"/> + + <!-- Try to login using invalid email and Sign In link from checkout page --> + <click selector="{{StorefrontCustomerSignInLinkSection.signInLink}}" stepKey="clickOnCustomizeAndAddToCartButton"/> + <fillField selector="{{StorefrontCustomerSignInLinkSection.email}}" userInput="invalid @example.com" stepKey="fillEmail"/> + <fillField selector="{{StorefrontCustomerSignInLinkSection.password}}" userInput="Password123" stepKey="fillPassword"/> + <click selector="{{StorefrontCustomerSignInLinkSection.signInBtn}}" stepKey="clickSignInBtn"/> + + <waitForElementVisible selector="#login-email-error" stepKey="waitForFormValidation"/> + <see selector="#login-email-error" userInput="Please enter a valid email address (Ex: johndoe@domain.com)." stepKey="seeTheCorrectErrorMessageIsDisplayed"/> + </test> +</tests> diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js b/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js index 9c00050d886e8..ad44c00763dcd 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js @@ -45,13 +45,6 @@ define([ resolveEstimationAddress: function () { var address; - if (checkoutData.getShippingAddressFromData()) { - address = addressConverter.formAddressDataToQuoteAddress(checkoutData.getShippingAddressFromData()); - selectShippingAddress(address); - } else { - this.resolveShippingAddress(); - } - if (quote.isVirtual()) { if (checkoutData.getBillingAddressFromData()) { address = addressConverter.formAddressDataToQuoteAddress( @@ -61,6 +54,11 @@ define([ } else { this.resolveBillingAddress(); } + } else if (checkoutData.getShippingAddressFromData()) { + address = addressConverter.formAddressDataToQuoteAddress(checkoutData.getShippingAddressFromData()); + selectShippingAddress(address); + } else { + this.resolveShippingAddress(); } }, diff --git a/app/code/Magento/Checkout/view/frontend/web/template/authentication.html b/app/code/Magento/Checkout/view/frontend/web/template/authentication.html index 4afaf3c89a5e0..97930a26a2f99 100644 --- a/app/code/Magento/Checkout/view/frontend/web/template/authentication.html +++ b/app/code/Magento/Checkout/view/frontend/web/template/authentication.html @@ -42,18 +42,20 @@ <div class="block-content" aria-labelledby="block-customer-login-heading"> <form data-role="login" data-bind="submit:login" - method="post"> + method="post" + novalidate="novalidate"> <div class="fieldset" data-bind="attr: {'data-hasrequired': $t('* Required Fields')}"> <div class="field field-email required"> <label class="label" for="login-email"><span data-bind="i18n: 'Email Address'"></span></label> <div class="control"> - <input type="email" - class="input-text" + <input name="username" id="login-email" - name="username" + type="email" + class="input-text" data-bind="attr: {autocomplete: autocomplete}" - data-validate="{required:true, 'validate-email':true}" /> + data-validate="{required:true, 'validate-email':true}" + /> </div> </div> <div class="field field-password required"> diff --git a/app/code/Magento/ConfigurableProduct/Plugin/Model/ResourceModel/Attribute/ScopedOptionSelectBuilder.php b/app/code/Magento/ConfigurableProduct/Plugin/Model/ResourceModel/Attribute/ScopedOptionSelectBuilder.php new file mode 100644 index 0000000000000..20d1ac0c2d376 --- /dev/null +++ b/app/code/Magento/ConfigurableProduct/Plugin/Model/ResourceModel/Attribute/ScopedOptionSelectBuilder.php @@ -0,0 +1,61 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\ConfigurableProduct\Plugin\Model\ResourceModel\Attribute; + +use Magento\Catalog\Model\ResourceModel\Product\Website as ProductWebsiteResource; +use Magento\ConfigurableProduct\Model\ResourceModel\Attribute\OptionSelectBuilderInterface; +use Magento\Framework\DB\Select; +use Magento\Store\Model\StoreManagerInterface; + +/** + * Plugin for OptionSelectBuilderInterface to filter by website assignments. + */ +class ScopedOptionSelectBuilder +{ + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var ProductWebsiteResource + */ + private $productWebsiteResource; + + /** + * @param StoreManagerInterface $storeManager + * @param ProductWebsiteResource $productWebsiteResource + */ + public function __construct( + StoreManagerInterface $storeManager, + ProductWebsiteResource $productWebsiteResource + ) { + $this->storeManager = $storeManager; + $this->productWebsiteResource = $productWebsiteResource; + } + + /** + * Add website filter to select. + * + * @param OptionSelectBuilderInterface $subject + * @param Select $select + * @return Select + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterGetSelect(OptionSelectBuilderInterface $subject, Select $select) + { + $store = $this->storeManager->getStore(); + $select->joinInner( + ['entity_website' => $this->productWebsiteResource->getMainTable()], + 'entity_website.product_id = entity.entity_id AND entity_website.website_id = ' . $store->getWebsiteId(), + [] + ); + + return $select; + } +} diff --git a/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml b/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml index 3942ec52cbb8b..56418bbaad122 100644 --- a/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml +++ b/app/code/Magento/ConfigurableProduct/etc/frontend/di.xml @@ -9,6 +9,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\ConfigurableProduct\Model\ResourceModel\Attribute\OptionSelectBuilderInterface"> <plugin name="Magento_ConfigurableProduct_Plugin_Model_ResourceModel_Attribute_InStockOptionSelectBuilder" type="Magento\ConfigurableProduct\Plugin\Model\ResourceModel\Attribute\InStockOptionSelectBuilder"/> + <plugin name="option_select_website_filter" type="Magento\ConfigurableProduct\Plugin\Model\ResourceModel\Attribute\ScopedOptionSelectBuilder"/> </type> <type name="Magento\ConfigurableProduct\Model\Product\Type\Configurable"> <plugin name="used_products_cache" type="Magento\ConfigurableProduct\Model\Plugin\Frontend\UsedProductsCache" /> diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/Variant/Collection.php b/app/code/Magento/ConfigurableProductGraphQl/Model/Variant/Collection.php index cd6d78e5c3ffb..7a327305fd27c 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/Model/Variant/Collection.php +++ b/app/code/Magento/ConfigurableProductGraphQl/Model/Variant/Collection.php @@ -120,10 +120,10 @@ public function addEavAttributes(array $attributeCodes) : void * Retrieve child products from for passed in parent id. * * @param int $id - * @param ContextInterface|null $context + * @param ContextInterface $context * @return array */ - public function getChildProductsByParentId(int $id, ContextInterface $context = null) : array + public function getChildProductsByParentId(int $id, ContextInterface $context) : array { $childrenMap = $this->fetch($context); @@ -137,10 +137,10 @@ public function getChildProductsByParentId(int $id, ContextInterface $context = /** * Fetch all children products from parent id's. * - * @param ContextInterface|null $context + * @param ContextInterface $context * @return array */ - private function fetch(ContextInterface $context = null) : array + private function fetch(ContextInterface $context) : array { if (empty($this->parentProducts) || !empty($this->childrenMap)) { return $this->childrenMap; @@ -151,6 +151,7 @@ private function fetch(ContextInterface $context = null) : array /** @var ChildCollection $childCollection */ $childCollection = $this->childCollectionFactory->create(); $childCollection->setProductFilter($product); + $childCollection->addWebsiteFilter($context->getExtensionAttributes()->getStore()->getWebsiteId()); $this->collectionProcessor->process( $childCollection, $this->searchCriteriaBuilder->create(), diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml b/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml index 06206e35712ad..56cff716ab6f8 100644 --- a/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml +++ b/app/code/Magento/ConfigurableProductGraphQl/etc/graphql/di.xml @@ -50,6 +50,7 @@ <type name="Magento\ConfigurableProduct\Model\ResourceModel\Attribute\OptionSelectBuilderInterface"> <plugin name="Magento_ConfigurableProduct_Plugin_Model_ResourceModel_Attribute_InStockOptionSelectBuilder_GraphQl" type="Magento\ConfigurableProduct\Plugin\Model\ResourceModel\Attribute\InStockOptionSelectBuilder"/> + <plugin name="option_select_website_filter" type="Magento\ConfigurableProduct\Plugin\Model\ResourceModel\Attribute\ScopedOptionSelectBuilder"/> </type> <type name="Magento\StoreGraphQl\Model\Resolver\Store\StoreConfigDataProvider"> diff --git a/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifySecureCookieTest.xml b/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifySecureCookieTest.xml index 337410d61c06d..d91093034dd2c 100644 --- a/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifySecureCookieTest.xml +++ b/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifySecureCookieTest.xml @@ -45,5 +45,10 @@ <actualResult type="variable">isCookieSecure</actualResult> <expectedResult type="string">true</expectedResult> </assertEquals> + <executeJS function="return jQuery.mage.cookies.defaults.secure ? 'true' : 'false'" stepKey="isCookieSecure2"/> + <assertEquals stepKey="assertCookieIsSecure2"> + <actualResult type="variable">isCookieSecure2</actualResult> + <expectedResult type="string">true</expectedResult> + </assertEquals> </test> </tests> diff --git a/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifyUnsecureCookieTest.xml b/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifyUnsecureCookieTest.xml index dccb432273b89..fbf90df6bf898 100644 --- a/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifyUnsecureCookieTest.xml +++ b/app/code/Magento/Cookie/Test/Mftf/Test/StorefrontVerifyUnsecureCookieTest.xml @@ -32,5 +32,10 @@ <actualResult type="variable">isCookieSecure</actualResult> <expectedResult type="string">false</expectedResult> </assertEquals> + <executeJS function="return jQuery.mage.cookies.defaults.secure ? 'true' : 'false'" stepKey="isCookieSecure2"/> + <assertEquals stepKey="assertCookieIsSecure2"> + <actualResult type="variable">isCookieSecure2</actualResult> + <expectedResult type="string">false</expectedResult> + </assertEquals> </test> </tests> diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml index 4eb5e8aa02401..4dcedb12c96b2 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml @@ -20,6 +20,7 @@ <element name="pager" type="block" selector=".pager"/> <element name="createdDate" type="text" selector=".block-order-details-comments .comment-date"/> <element name="orderPlacedBy" type="text" selector=".block-order-details-comments .comment-content"/> + <element name="orderComment" type="text" selector=".block-order-details-comments .comment-content"/> <element name="productName" type="text" selector="//td[@data-th='Product Name']"/> <element name="productRows" type="text" selector="#my-orders-table tbody tr"/> <element name="productNameByRow" type="text" parameterized="true" selector="#my-orders-table tbody:nth-of-type({{index}}) td.name"/> diff --git a/app/code/Magento/Elasticsearch/Model/Adapter/Index/Builder.php b/app/code/Magento/Elasticsearch/Model/Adapter/Index/Builder.php index f5a70d2d09538..50317809ffcfe 100644 --- a/app/code/Magento/Elasticsearch/Model/Adapter/Index/Builder.php +++ b/app/code/Magento/Elasticsearch/Model/Adapter/Index/Builder.php @@ -58,7 +58,7 @@ public function build() 'type' => 'custom', 'tokenizer' => key($tokenizer), 'filter' => array_merge( - ['lowercase', 'keyword_repeat'], + ['lowercase', 'keyword_repeat', 'asciifolding'], array_keys($filter) ), 'char_filter' => array_keys($charFilter) @@ -67,16 +67,14 @@ public function build() 'prefix_search' => [ 'type' => 'custom', 'tokenizer' => key($tokenizer), - 'filter' => array_merge( - ['lowercase', 'keyword_repeat'] - ), + 'filter' => ['lowercase', 'keyword_repeat', 'asciifolding'], 'char_filter' => array_keys($charFilter) ], 'sku' => [ 'type' => 'custom', 'tokenizer' => 'keyword', 'filter' => array_merge( - ['lowercase', 'keyword_repeat'], + ['lowercase', 'keyword_repeat', 'asciifolding'], array_keys($filter) ), ], @@ -84,9 +82,7 @@ public function build() 'sku_prefix_search' => [ 'type' => 'custom', 'tokenizer' => 'keyword', - 'filter' => array_merge( - ['lowercase', 'keyword_repeat'] - ), + 'filter' => ['lowercase', 'keyword_repeat', 'asciifolding'] ] ], 'tokenizer' => $tokenizer, diff --git a/app/code/Magento/Elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchResultApplier.php b/app/code/Magento/Elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchResultApplier.php index 54b8c1966ee12..07d05bae73d4c 100644 --- a/app/code/Magento/Elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchResultApplier.php +++ b/app/code/Magento/Elasticsearch/Model/ResourceModel/Fulltext/Collection/SearchResultApplier.php @@ -69,22 +69,11 @@ public function apply() foreach ($items as $item) { $ids[] = (int)$item->getId(); } + $orderList = join(',', $ids); $this->collection->getSelect() ->where('e.entity_id IN (?)', $ids) - ->reset(\Magento\Framework\DB\Select::ORDER); - $sortOrder = $this->searchResult->getSearchCriteria() - ->getSortOrders(); - if (!empty($sortOrder['price']) && $this->collection->getLimitationFilters()->isUsingPriceIndex()) { - $sortDirection = $sortOrder['price']; - $this->collection->getSelect() - ->order( - new \Zend_Db_Expr("price_index.min_price = 0, price_index.min_price {$sortDirection}") - ); - } else { - $orderList = join(',', $ids); - $this->collection->getSelect() - ->order(new \Zend_Db_Expr("FIELD(e.entity_id,$orderList)")); - } + ->reset(\Magento\Framework\DB\Select::ORDER) + ->order(new \Zend_Db_Expr("FIELD(e.entity_id,$orderList)")); } /** diff --git a/app/code/Magento/Email/Model/Template/Filter.php b/app/code/Magento/Email/Model/Template/Filter.php index 18435d85574f3..120d67931597f 100644 --- a/app/code/Magento/Email/Model/Template/Filter.php +++ b/app/code/Magento/Email/Model/Template/Filter.php @@ -36,6 +36,8 @@ use Magento\Variable\Model\Variable; use Magento\Variable\Model\VariableFactory; use Psr\Log\LoggerInterface; +use Magento\Store\Model\Information as StoreInformation; +use Magento\Framework\App\ObjectManager; /** * Core Email Template Filter Model @@ -201,6 +203,11 @@ class Filter extends Template */ private $pubDirectoryRead; + /** + * @var StoreInformation + */ + private $storeInformation; + /** * Filter constructor. @@ -222,6 +229,7 @@ class Filter extends Template * @param CssInliner $cssInliner * @param array $variables * @param array $directiveProcessors + * @param StoreInformation|null $storeInformation * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -242,7 +250,8 @@ public function __construct( Filesystem $pubDirectory, CssInliner $cssInliner, $variables = [], - array $directiveProcessors = [] + array $directiveProcessors = [], + ?StoreInformation $storeInformation = null ) { $this->_escaper = $escaper; $this->_assetRepo = $assetRepo; @@ -259,6 +268,8 @@ public function __construct( $this->cssProcessor = $cssProcessor; $this->pubDirectory = $pubDirectory; $this->configVariables = $configVariables; + $this->storeInformation = $storeInformation ?: + ObjectManager::getInstance()->get(StoreInformation::class); parent::__construct($string, $variables, $directiveProcessors, $variableResolver); } @@ -825,18 +836,29 @@ private function validateProtocolDirectiveHttpScheme(array $params) : void * * @param string[] $construction * @return string + * @throws NoSuchEntityException */ public function configDirective($construction) { $configValue = ''; $params = $this->getParameters($construction[2]); $storeId = $this->getStoreId(); + $store = $this->_storeManager->getStore($storeId); + $storeInformationObj = $this->storeInformation + ->getStoreInformationObject($store); if (isset($params['path']) && $this->isAvailableConfigVariable($params['path'])) { $configValue = $this->_scopeConfig->getValue( $params['path'], ScopeInterface::SCOPE_STORE, $storeId ); + if ($params['path'] == $this->storeInformation::XML_PATH_STORE_INFO_COUNTRY_CODE) { + $configValue = $storeInformationObj->getData('country'); + } elseif ($params['path'] == $this->storeInformation::XML_PATH_STORE_INFO_REGION_CODE) { + $configValue = $storeInformationObj->getData('region')? + $storeInformationObj->getData('region'): + $configValue; + } } return $configValue; } diff --git a/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php b/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php index 97a684b92be5d..923193f6e6a92 100644 --- a/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php +++ b/app/code/Magento/Email/Test/Unit/Model/Template/FilterTest.php @@ -14,6 +14,7 @@ use Magento\Framework\App\Area; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\Filesystem\DirectoryList; +use Magento\Framework\DataObject; use Magento\Framework\Exception\MailException; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\App\State; @@ -35,12 +36,14 @@ use Magento\Framework\View\LayoutFactory; use Magento\Framework\View\LayoutInterface; use Magento\Store\Api\Data\StoreInterface; +use Magento\Store\Model\Store; use Magento\Store\Model\StoreManagerInterface; use Magento\Variable\Model\Source\Variables; use Magento\Variable\Model\VariableFactory; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; +use Magento\Store\Model\Information as StoreInformation; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -148,6 +151,16 @@ class FilterTest extends TestCase */ private $directiveProcessors; + /** + * @var StoreInformation + */ + private $storeInformation; + + /** + * @var store + */ + private $store; + protected function setUp(): void { $this->objectManager = new ObjectManager($this); @@ -232,6 +245,14 @@ protected function setUp(): void ->disableOriginalConstructor() ->getMock(), ]; + + $this->store = $this->getMockBuilder(Store::class) + ->disableOriginalConstructor() + ->getMock(); + + $this->storeInformation = $this->getMockBuilder(StoreInformation::class) + ->disableOriginalConstructor() + ->getMock(); } /** @@ -260,7 +281,8 @@ protected function getModel($mockedMethods = null) $this->pubDirectory, $this->cssInliner, [], - $this->directiveProcessors + $this->directiveProcessors, + $this->storeInformation ] ) ->setMethods($mockedMethods) @@ -421,12 +443,10 @@ public function testConfigDirectiveAvailable() $construction = ["{{config path={$path}}}", 'config', " path={$path}"]; $scopeConfigValue = 'value'; - $storeMock = $this->getMockBuilder(StoreInterface::class) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - - $this->storeManager->expects($this->once())->method('getStore')->willReturn($storeMock); - $storeMock->expects($this->once())->method('getId')->willReturn(1); + $this->storeManager->expects($this->any()) + ->method('getStore') + ->willReturn($this->store); + $this->store->expects($this->any())->method('getId')->willReturn(1); $this->configVariables->expects($this->once()) ->method('getData') @@ -435,6 +455,10 @@ public function testConfigDirectiveAvailable() ->method('getValue') ->willReturn($scopeConfigValue); + $this->storeInformation->expects($this->once()) + ->method('getStoreInformationObject') + ->willReturn(new DataObject([])); + $this->assertEquals($scopeConfigValue, $this->getModel()->configDirective($construction)); } @@ -445,11 +469,10 @@ public function testConfigDirectiveUnavailable() $construction = ["{{config path={$path}}}", 'config', " path={$path}"]; $scopeConfigValue = ''; - $storeMock = $this->getMockBuilder(StoreInterface::class) - ->disableOriginalConstructor() - ->getMockForAbstractClass(); - $this->storeManager->expects($this->once())->method('getStore')->willReturn($storeMock); - $storeMock->expects($this->once())->method('getId')->willReturn(1); + $this->storeManager->expects($this->any()) + ->method('getStore') + ->willReturn($this->store); + $this->store->expects($this->any())->method('getId')->willReturn(1); $this->configVariables->expects($this->once()) ->method('getData') @@ -458,9 +481,65 @@ public function testConfigDirectiveUnavailable() ->method('getValue') ->willReturn($scopeConfigValue); + $this->storeInformation->expects($this->once()) + ->method('getStoreInformationObject') + ->willReturn(new DataObject([])); + $this->assertEquals($scopeConfigValue, $this->getModel()->configDirective($construction)); } + /** + * @throws NoSuchEntityException + */ + public function testConfigDirectiveGetCountry() + { + $path = "general/store_information/country_id"; + $availableConfigs = [['value' => $path]]; + $construction = ["{{config path={$path}}}", 'config', " path={$path}"]; + $expectedCountry = 'United States'; + + $this->storeManager->expects($this->any()) + ->method('getStore') + ->willReturn($this->store); + $this->store->expects($this->any())->method('getId')->willReturn(1); + + $this->configVariables->expects($this->once()) + ->method('getData') + ->willReturn($availableConfigs); + + $this->storeInformation->expects($this->once()) + ->method('getStoreInformationObject') + ->willReturn(new DataObject(['country_id' => 'US', 'country' => 'United States'])); + + $this->assertEquals($expectedCountry, $this->getModel()->configDirective($construction)); + } + + /** + * @throws NoSuchEntityException + */ + public function testConfigDirectiveGetRegion() + { + $path = "general/store_information/region_id"; + $availableConfigs = [['value' => $path]]; + $construction = ["{{config path={$path}}}", 'config', " path={$path}"]; + $expectedRegion = 'Texas'; + + $this->storeManager->expects($this->any()) + ->method('getStore') + ->willReturn($this->store); + $this->store->expects($this->any())->method('getId')->willReturn(1); + + $this->configVariables->expects($this->once()) + ->method('getData') + ->willReturn($availableConfigs); + + $this->storeInformation->expects($this->once()) + ->method('getStoreInformationObject') + ->willReturn(new DataObject(['region_id' => '57', 'region' => 'Texas'])); + + $this->assertEquals($expectedRegion, $this->getModel()->configDirective($construction)); + } + /** * @throws MailException * @throws NoSuchEntityException diff --git a/app/code/Magento/Persistent/Model/QuoteManager.php b/app/code/Magento/Persistent/Model/QuoteManager.php index 35b07ebdb7c44..c649d0252c298 100644 --- a/app/code/Magento/Persistent/Model/QuoteManager.php +++ b/app/code/Magento/Persistent/Model/QuoteManager.php @@ -182,6 +182,7 @@ public function convertCustomerCartToGuest() $quote->getAddressesCollection()->walk('setCustomerId', ['customerId' => null]); $quote->getAddressesCollection()->walk('setEmail', ['email' => null]); $quote->collectTotals(); + $quote->getCustomer()->setId(null); $this->persistentSession->getSession()->removePersistentCookie(); $this->persistentSession->setSession(null); $this->quoteRepository->save($quote); diff --git a/app/code/Magento/Persistent/Test/Unit/Model/QuoteManagerTest.php b/app/code/Magento/Persistent/Test/Unit/Model/QuoteManagerTest.php index ece36673c1e82..f3c70a2c8550f 100644 --- a/app/code/Magento/Persistent/Test/Unit/Model/QuoteManagerTest.php +++ b/app/code/Magento/Persistent/Test/Unit/Model/QuoteManagerTest.php @@ -134,6 +134,7 @@ protected function setUp(): void 'setExtensionAttributes', '__wakeup', 'setCustomer', + 'getCustomer' ]) ->disableOriginalConstructor() ->getMock(); @@ -343,6 +344,13 @@ public function testConvertCustomerCartToGuest() ->method('setIsPersistent')->with(false)->willReturn($this->quoteMock); $this->quoteMock->expects($this->exactly(3)) ->method('getAddressesCollection')->willReturn($this->abstractCollectionMock); + $customerMock = $this->createMock(CustomerInterface::class); + $customerMock->expects($this->once()) + ->method('setId') + ->with(null) + ->willReturnSelf(); + $this->quoteMock->expects($this->once()) + ->method('getCustomer')->willReturn($customerMock); $this->abstractCollectionMock->expects($this->exactly(3))->method('walk')->with( $this->logicalOr( $this->equalTo('setCustomerAddressId'), diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminUploadSameVimeoVideoForMultipleProductsTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminUploadSameVimeoVideoForMultipleProductsTest.xml new file mode 100644 index 0000000000000..5b346040db818 --- /dev/null +++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminUploadSameVimeoVideoForMultipleProductsTest.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminUploadSameVimeoVideoForMultipleProductsTest"> + <annotations> + <features value="ProductVideo"/> + <stories value="Upload product video"/> + <title value="Admin should be able to upload same Vimeo video for multiple products"/> + <description value="Admin should be able to upload same Vimeo video for multiple products"/> + <severity value="MAJOR"/> + <testCaseId value="MC-42645"/> + <useCaseId value="MC-42448"/> + <group value="productVideo"/> + </annotations> + <before> + <createData entity="ProductVideoYoutubeApiKeyConfig" stepKey="setYoutubeApiKeyConfig"/> + <createData entity="SimpleProduct2" stepKey="createProduct1"/> + <createData entity="SimpleProduct2" stepKey="createProduct2"/> + <!-- Login to Admin page --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <createData entity="DefaultProductVideoConfig" stepKey="setYoutubeApiKeyDefaultConfig"/> + <deleteData createDataKey="createProduct1" stepKey="deleteProduct1"/> + <deleteData createDataKey="createProduct2" stepKey="deleteProduct2"/> + <!-- Logout from Admin page --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + + <!-- Open product 1 edit page --> + <amOnPage url="{{AdminProductEditPage.url($createProduct1.id$)}}" stepKey="goToProduct1EditPage"/> + <!-- Add product video --> + <actionGroup ref="AddProductVideoActionGroup" stepKey="addProductVideoToProduct1"> + <argument name="video" value="VimeoProductVideo"/> + </actionGroup> + <!-- Save product form --> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormOfProduct1"/> + + <!-- Open product 2 edit page --> + <amOnPage url="{{AdminProductEditPage.url($createProduct2.id$)}}" stepKey="goToProduct2EditPage"/> + <!-- Add product video --> + <actionGroup ref="AddProductVideoActionGroup" stepKey="saveProductFormOfProduct2"> + <argument name="video" value="VimeoProductVideo"/> + </actionGroup> + <!-- Save product form --> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductFormOfSecondSimpleProduct"/> + + </test> +</tests> diff --git a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml index b09f2fb376327..cf47b2f8e18c4 100755 --- a/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml +++ b/app/code/Magento/Quote/Test/Mftf/Data/CustomerCartData.xml @@ -30,4 +30,8 @@ <requiredEntity type="payment_method">CashOnDeliveryPaymentMethod</requiredEntity> <requiredEntity type="billing_address">BillingAddressTX</requiredEntity> </entity> + + <entity name="GetOrderData" type="CustomerCart"> + <var key="cart_id" entityKey="return" entityType="CustomerCart"/> + </entity> </entities> diff --git a/app/code/Magento/Quote/Test/Mftf/Metadata/CustomerCartMeta.xml b/app/code/Magento/Quote/Test/Mftf/Metadata/CustomerCartMeta.xml index f233954f2cdcf..95773d82beb29 100644 --- a/app/code/Magento/Quote/Test/Mftf/Metadata/CustomerCartMeta.xml +++ b/app/code/Magento/Quote/Test/Mftf/Metadata/CustomerCartMeta.xml @@ -60,4 +60,9 @@ <field key="method">string</field> </object> </operation> + + <operation name="GetOrderData" dataType="CustomerCart" type="get" auth="adminOauth" url="/V1/orders/{return}" method="GET"> + <contentType>application/json</contentType> + </operation> + </operations> diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php index ad305c8b7199f..3a4e8184f82cb 100644 --- a/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php +++ b/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentCommentSender.php @@ -75,6 +75,7 @@ public function send(Shipment $shipment, $notify = true, $comment = '') 'formattedBillingAddress' => $this->getFormattedBillingAddress($order), 'order_data' => [ 'customer_name' => $order->getCustomerName(), + 'is_not_virtual' => $order->getIsNotVirtual(), 'frontend_status_label' => $order->getFrontendStatusLabel() ] ]; diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenOrderViewPageByOrderIdActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenOrderViewPageByOrderIdActionGroup.xml new file mode 100644 index 0000000000000..5bd1d5907f69d --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenOrderViewPageByOrderIdActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminOpenOrderViewPageByOrderIdActionGroup"> + <annotations> + <description>Opens the Order View Page in Admin using order_id</description> + </annotations> + <arguments> + <argument name="orderId" type="string"/> + </arguments> + + <amOnPage url="{{AdminOrderViewPage.url(orderId)}}" stepKey="openOrderViewPage"/> + <waitForPageLoad stepKey="waitForOrderViewPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSalesOrderCommentsActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSalesOrderCommentsActionGroup.xml new file mode 100644 index 0000000000000..af0237d3a6606 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSalesOrderCommentsActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminSalesOrderCommentsActionGroup"> + <annotations> + <description>Adding comments on admin sales order details page</description> + </annotations> + <arguments> + <argument name="comment" type="string" defaultValue=""/> + </arguments> + <fillField selector="{{AdminSalesOrderCommentsSection.historyComment}}" userInput="{{comment}}" stepKey="fillComment"/> + <checkOption selector="{{AdminSalesOrderCommentsSection.historyVisible}}" stepKey="checkVisibleOnStoreFront"/> + <click selector="{{AdminSalesOrderCommentsSection.submitOrderComment}}" stepKey="clickSaveCommentButton"/> + <waitForPageLoad stepKey="waitForSaveComments"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontOpenMyOrdersPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontOpenMyOrdersPageActionGroup.xml new file mode 100644 index 0000000000000..39f4e65f4c687 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/StorefrontOpenMyOrdersPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="StorefrontOpenMyOrdersPageActionGroup"> + <annotations> + <description>Opens the "My Account->"My Orders" Page</description> + </annotations> + + <amOnPage url="/sales/order/history/" stepKey="openMyOrdersPage"/> + <waitForPageLoad stepKey="waitForMyOrdersPage"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Data/OrderCommentsData.xml b/app/code/Magento/Sales/Test/Mftf/Data/OrderCommentsData.xml new file mode 100644 index 0000000000000..b7c5bb457ca08 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Data/OrderCommentsData.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="SalesOrderComments" type="order"> + <data key="commentWithHyperlink"><a href="https://business.adobe.com/products/magento/magento-commerce.html">Testing Html Tags</a></data> + </entity> + <entity name="anchorTagFragment" type="string"> + <data key="anchorTag">a href</data> + </entity> +</entities> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminSalesOrderCommentsSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminSalesOrderCommentsSection.xml new file mode 100644 index 0000000000000..c7f2628a900e3 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminSalesOrderCommentsSection.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminSalesOrderCommentsSection"> + <element name="historyComment" type="textarea" selector="#history_comment"/> + <element name="historyVisible" type="checkbox" selector="#history_visible"/> + <element name="submitOrderComment" type="button" selector=".order-history-comments-actions>button"/> + </section> +</sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml index 5f454152de20c..660c3698648e5 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCancelTheCreatedOrderWithCashOnDeliveryPaymentMethodTest.xml @@ -22,19 +22,25 @@ <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - <!-- Enable Cash On Delivery payment method --> <magentoCLI command="config:set {{EnableCashOnDeliveryConfigData.path}} {{EnableCashOnDeliveryConfigData.value}}" stepKey="enableCashOnDeliveryPayment"/> - - <!--Set default flat rate shipping method settings--> <magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> - <!--Create simple customer--> <createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"/> - <!-- Create Simple Product --> <createData entity="SimpleProduct2" stepKey="simpleProduct"> <field key="price">10.00</field> </createData> + + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="simpleCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="simpleProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> </before> <after> <magentoCLI command="config:set {{DisableCashOnDeliveryConfigData.path}} {{DisableCashOnDeliveryConfigData.value}}" stepKey="disableCashOnDeliveryPayment"/> @@ -43,39 +49,34 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <!-- Create new customer order --> - <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer"> - <argument name="customer" value="$$simpleCustomer$$"/> - </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="navigateToNewOrderWithExistingCustomer"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addSimpleProductToTheOrder"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectFlatRateShippingMethod"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPaymentOptions"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectCashOnDeliveryPaymentOption"/> - <!-- Add Simple product to order --> - <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToTheOrder"> - <argument name="product" value="$$simpleProduct$$"/> - </actionGroup> - - <!-- Select FlatRate shipping method --> - <actionGroup ref="AdminSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/> + <updateData createDataKey="createCustomerCart" entity="CashOnDeliveryOrderPaymentMethod" stepKey="submitOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> - <!-- Select Cash On Delivery payment method --> - <waitForElementVisible selector="{{AdminOrderFormPaymentSection.paymentBlock}}" stepKey="waitForPaymentOptions"/> - <checkOption selector="{{AdminOrderFormPaymentSection.cashOnDeliveryOption}}" stepKey="selectCashOnDeliveryPaymentOption"/> - <actionGroup ref="AdminOrderClickSubmitOrderActionGroup" stepKey="submitOrder" /> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="verifyCreatedOrderInformation"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="orderId"/> - <!--Verify order information--> - <actionGroup ref="VerifyCreatedOrderInformationActionGroup" stepKey="verifyCreatedOrderInformation"/> - <grabTextFrom selector="|Order # (\d+)|" stepKey="orderId"/> + <actionGroup ref="AdminOpenOrderViewPageByOrderIdActionGroup" stepKey="openOrder"> + <argument name="orderId" value="$createCustomerCart.return$"/> + </actionGroup> - <!-- Cancel the Order --> <actionGroup ref="CancelPendingOrderActionGroup" stepKey="cancelPendingOrder"/> - - <!--Log in to Storefront as Customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="signUp"> <argument name="Customer" value="$$simpleCustomer$$"/> </actionGroup> - - <!-- Assert Order status in frontend grid --> - <click selector="{{StorefrontCustomerSidebarSection.sidebarCurrentTab('My Orders')}}" stepKey="clickOnMyOrders"/> - <waitForPageLoad stepKey="waitForOrderDetailsToLoad"/> - <seeElement selector="{{StorefrontCustomerOrderViewSection.orderStatusInGrid('$orderId', 'Canceled')}}" stepKey="seeOrderStatusInGrid"/> + + <getData entity="GetOrderData" stepKey="getOrderData"> + <requiredEntity createDataKey="createCustomerCart"/> + </getData> + <actionGroup ref="StorefrontOpenMyOrdersPageActionGroup" stepKey="clickOnMyOrders"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForOrderDetailsToLoad"/> + <seeElement selector="{{StorefrontCustomerOrderViewSection.orderStatusInGrid('$createCustomerCart.increment_id$', 'Canceled')}}" stepKey="seeOrderStatusInGrid"/> </test> </tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifyOrderHistoryCommentsTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifyOrderHistoryCommentsTest.xml new file mode 100644 index 0000000000000..2f4042d4d9760 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifyOrderHistoryCommentsTest.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontVerifyOrderHistoryCommentsTest"> + <annotations> + <features value="Sales"/> + <stories value="Storefront Customer Order History Comments"/> + <title value="Verify Customer Order History Comments For Storefront My Account Sales Pages"/> + <description value="Verify that the Customer order History comments without the HTML tags to the My Orders pages on the Storefront"/> + <testCaseId value="MC-42694"/> + <useCaseId value="MC-42531"/> + <severity value="MINOR"/> + <group value="Sales"/> + </annotations> + <before> + <!-- Create customer --> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <!-- Create product --> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> + </before> + <after> + <!-- Customer log out --> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> + <!-- Admin log out --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <!-- Delete customer --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <!-- Delete product --> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + </after> + <!-- Login as customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <!-- Add product to cart --> + <actionGroup ref="StorefrontAddSimpleProductWithQtyActionGroup" stepKey="addSimpleProductToCart"> + <argument name="product" value="$$createProduct$$"/> + <argument name="quantity" value="1"/> + </actionGroup> + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> + <actionGroup ref="CheckoutSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRate"/> + <actionGroup ref="StorefrontCheckoutForwardFromShippingStepActionGroup" stepKey="goToReview"/> + <actionGroup ref="CheckoutSelectCheckMoneyOrderPaymentActionGroup" stepKey="selectCheckMoneyOrder"/> + <actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="clickOnPlaceOrder"> + <argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/> + <argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> + </actionGroup> + + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="orderNumber"/> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + <actionGroup ref="OpenOrderByIdActionGroup" stepKey="addFilterToGridAndOpenOrder"> + <argument name="orderId" value="{$orderNumber}"/> + </actionGroup> + + <actionGroup ref="AdminSalesOrderCommentsActionGroup" stepKey="fillAndSaveOrderComments"> + <argument name="comment" value="{{SalesOrderComments.commentWithHyperlink}}" /> + </actionGroup> + + <actionGroup ref="StorefrontOpenMyAccountPageActionGroup" stepKey="navigateToCustomerDashboardPage"/> + <actionGroup ref="StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup" stepKey="clickViewOrder"/> + + <dontSee userInput="{{anchorTagFragment.anchorTag}}" selector="{{StorefrontCustomerOrderViewSection.orderComment}}" stepKey="dontSeeExposedHtmlCode"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/ShipmentCommentSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/ShipmentCommentSenderTest.php index 91e7ae18d3550..a3bf17ec4b27f 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/ShipmentCommentSenderTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/ShipmentCommentSenderTest.php @@ -62,8 +62,9 @@ public function testSendTrueWithoutCustomerCopy() { $billingAddress = $this->addressMock; $comment = 'comment_test'; - $customerName='Test Customer'; - $frontendStatusLabel='Processing'; + $customerName = 'Test Customer'; + $frontendStatusLabel = 'Processing'; + $isNotVirtual = true; $this->orderMock->expects($this->once()) ->method('getCustomerIsGuest') @@ -76,6 +77,9 @@ public function testSendTrueWithoutCustomerCopy() $this->orderMock->expects($this->any()) ->method('getCustomerName') ->willReturn($customerName); + $this->orderMock->expects($this->any()) + ->method('getIsNotVirtual') + ->willReturn($isNotVirtual); $this->orderMock->expects($this->once()) ->method('getFrontendStatusLabel') ->willReturn($frontendStatusLabel); @@ -92,7 +96,8 @@ public function testSendTrueWithoutCustomerCopy() 'formattedBillingAddress' => 1, 'order_data' => [ 'customer_name' => $customerName, - 'frontend_status_label' => $frontendStatusLabel + 'frontend_status_label' => $frontendStatusLabel, + 'is_not_virtual' => $isNotVirtual, ] ] ); @@ -105,8 +110,9 @@ public function testSendTrueWithCustomerCopy() { $billingAddress = $this->addressMock; $comment = 'comment_test'; - $customerName='Test Customer'; - $frontendStatusLabel='Processing'; + $customerName = 'Test Customer'; + $frontendStatusLabel = 'Processing'; + $isNotVirtual = true; $this->orderMock->expects($this->once()) ->method('getCustomerIsGuest') @@ -122,6 +128,9 @@ public function testSendTrueWithCustomerCopy() $this->orderMock->expects($this->any()) ->method('getCustomerName') ->willReturn($customerName); + $this->orderMock->expects($this->any()) + ->method('getIsNotVirtual') + ->willReturn($isNotVirtual); $this->orderMock->expects($this->once()) ->method('getFrontendStatusLabel') ->willReturn($frontendStatusLabel); @@ -138,7 +147,8 @@ public function testSendTrueWithCustomerCopy() 'formattedBillingAddress' => 1, 'order_data' => [ 'customer_name' => $customerName, - 'frontend_status_label' => $frontendStatusLabel + 'frontend_status_label' => $frontendStatusLabel, + 'is_not_virtual' => $isNotVirtual, ] ] ); @@ -152,8 +162,9 @@ public function testSendVirtualOrder() $isVirtualOrder = true; $this->orderMock->setData(OrderInterface::IS_VIRTUAL, $isVirtualOrder); $this->stepAddressFormat($this->addressMock, $isVirtualOrder); - $customerName='Test Customer'; - $frontendStatusLabel='Complete'; + $customerName = 'Test Customer'; + $frontendStatusLabel = 'Complete'; + $isNotVirtual = false; $this->identityContainerMock->expects($this->once()) ->method('isEnabled') @@ -161,6 +172,9 @@ public function testSendVirtualOrder() $this->orderMock->expects($this->any()) ->method('getCustomerName') ->willReturn($customerName); + $this->orderMock->expects($this->any()) + ->method('getIsNotVirtual') + ->willReturn($isNotVirtual); $this->orderMock->expects($this->once()) ->method('getFrontendStatusLabel') ->willReturn($frontendStatusLabel); @@ -177,7 +191,8 @@ public function testSendVirtualOrder() 'formattedBillingAddress' => 1, 'order_data' => [ 'customer_name' => $customerName, - 'frontend_status_label' => $frontendStatusLabel + 'frontend_status_label' => $frontendStatusLabel, + 'is_not_virtual' => $isNotVirtual ] ] diff --git a/app/code/Magento/Sales/view/frontend/templates/order/order_comments.phtml b/app/code/Magento/Sales/view/frontend/templates/order/order_comments.phtml index 6f2d8d87ade86..cb1e235566c8e 100644 --- a/app/code/Magento/Sales/view/frontend/templates/order/order_comments.phtml +++ b/app/code/Magento/Sales/view/frontend/templates/order/order_comments.phtml @@ -17,7 +17,7 @@ <?= /* @noEscape */ $block->formatDate($_historyItem->getCreatedAt(), \IntlDateFormatter::MEDIUM, true) ?> </dt> - <dd class="comment-content"><?= $block->escapeHtml($_historyItem->getComment()) ?></dd> + <dd class="comment-content"><?= $block->escapeHtml($_historyItem->getComment(), ['b', 'br', 'strong', 'i', 'u', 'a']) ?></dd> <?php endforeach; ?> </dl> </div> diff --git a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Generate.php b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Generate.php index cfafe110df22b..0bca04a955817 100644 --- a/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Generate.php +++ b/app/code/Magento/SalesRule/Controller/Adminhtml/Promo/Quote/Generate.php @@ -80,6 +80,10 @@ public function execute() if (!$rule->getId()) { $result['error'] = __('Rule is not defined'); + } elseif ((int) $rule->getCouponType() !== \Magento\SalesRule\Model\Rule::COUPON_TYPE_AUTO + && !$rule->getUseAutoGeneration()) { + $result['error'] = + __('The rule coupon settings changed. Please save the rule before using auto-generation.'); } else { try { $data = $this->getRequest()->getParams(); diff --git a/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml b/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml index df126f05819d0..7eb95da0d7500 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml @@ -104,5 +104,6 @@ <element name="generatedCouponByIndex" type="text" selector="#couponCodesGrid_table > tbody > tr:nth-child({{var}}) > td.col-code" parameterized="true"/> <element name="couponGridUsedHeader" type="text" selector="#couponCodesGrid thead th[data-sort='used']"/> <element name="fieldError" type="text" selector="//input[@name='{{fieldName}}']/following-sibling::label[@class='admin__field-error']" parameterized="true"/> + <element name="modalMessage" type="text" selector="aside.modal-popup div.modal-content div"/> </section> </sections> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminBlockCouponGeneratesUntilCartPriceRuleSavedWithSpecificCouponTypeAndAutoGenerationTickedTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminBlockCouponGeneratesUntilCartPriceRuleSavedWithSpecificCouponTypeAndAutoGenerationTickedTest.xml new file mode 100644 index 0000000000000..a4318103c4c00 --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminBlockCouponGeneratesUntilCartPriceRuleSavedWithSpecificCouponTypeAndAutoGenerationTickedTest.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminBlockCouponGeneratesUntilCartPriceRuleSavedWithSpecificCouponTypeAndAutoGenerationTickedTest"> + <annotations> + <features value="SalesRule"/> + <stories value="Create cart price rule"/> + <title value="Block the coupon generates until cart price rule is saved with Specific Coupon type and Use Auto Generation ticked"/> + <description + value="Block the coupon generates until cart price rule is saved with Specific Coupon type and Use Auto Generation ticked"/> + <severity value="MINOR"/> + <testCaseId value="MC-42602"/> + <useCaseId value="MC-42288"/> + <group value="salesRule"/> + </annotations> + + <before> + <createData entity="ApiCartRule" stepKey="createSalesRule"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + + <after> + <deleteData createDataKey="createSalesRule" stepKey="deleteSalesRule"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> + </after> + + <!-- Search Cart Price Rule and go to edit Cart Price Rule --> + <actionGroup ref="AdminOpenCartPriceRulesPageActionGroup" stepKey="amOnCartPriceList"/> + <fillField selector="{{AdminCartPriceRulesSection.filterByNameInput}}" userInput="$$createSalesRule.name$$" + stepKey="fillFieldFilterByName"/> + <click selector="{{AdminCartPriceRulesSection.searchButton}}" stepKey="clickSearchButton"/> + <see selector="{{AdminCartPriceRulesSection.nameColumns}}" userInput="$$createSalesRule.name$$" + stepKey="seeRuleName"/> + <click selector="{{AdminCartPriceRulesSection.rowContainingText($$createSalesRule.name$$)}}" + stepKey="goToEditRule"/> + + <!-- Choose coupon type specific coupon and tick auto generation checkbox --> + <selectOption selector="{{AdminCartPriceRulesFormSection.coupon}}" userInput="Specific Coupon" stepKey="selectCouponType"/> + <checkOption selector="{{AdminCartPriceRulesFormSection.useAutoGeneration}}" stepKey="tickAutoGeneration"/> + + <!-- Navigate to Manage Coupon Codes section to generate 1 coupon code --> + <conditionalClick selector="{{AdminCartPriceRulesFormSection.manageCouponCodesHeader}}" + dependentSelector="{{AdminCartPriceRulesFormSection.manageCouponCodesHeader}}" visible="true" + stepKey="clickManageCouponCodes"/> + <fillField selector="{{AdminCartPriceRulesFormSection.couponQty}}" userInput="1" stepKey="fillFieldCouponQty"/> + <click selector="{{AdminCartPriceRulesFormSection.generateCouponsButton}}" stepKey="clickGenerateCoupon"/> + <see selector="{{AdminCartPriceRulesFormSection.modalMessage}}" userInput="The rule coupon settings changed. Please save the rule before using auto-generation." + stepKey="seeModalMessage"/> + </test> +</tests> diff --git a/app/code/Magento/SalesRule/Test/Unit/Controller/Adminhtml/Promo/Quote/GenerateTest.php b/app/code/Magento/SalesRule/Test/Unit/Controller/Adminhtml/Promo/Quote/GenerateTest.php index 9c8761eb39738..fd0b864ab9201 100644 --- a/app/code/Magento/SalesRule/Test/Unit/Controller/Adminhtml/Promo/Quote/GenerateTest.php +++ b/app/code/Magento/SalesRule/Test/Unit/Controller/Adminhtml/Promo/Quote/GenerateTest.php @@ -137,9 +137,9 @@ protected function setUp(): void } /** - * testExecute + * @covers \Magento\SalesRule\Controller\Adminhtml\Promo\Quote::execute */ - public function testExecute() + public function testExecuteWithCouponTypeAuto() { $helperData = $this->getMockBuilder(Data::class) ->disableOriginalConstructor() @@ -157,6 +157,8 @@ public function testExecute() ->method('isAjax') ->willReturn(true); $ruleMock = $this->getMockBuilder(Rule::class) + ->addMethods(['getCouponType']) + ->onlyMethods(['getId']) ->disableOriginalConstructor() ->getMock(); $this->registryMock->expects($this->once()) @@ -165,6 +167,9 @@ public function testExecute() $ruleMock->expects($this->once()) ->method('getId') ->willReturn(1); + $ruleMock->expects($this->once()) + ->method('getCouponType') + ->willReturn(\Magento\SalesRule\Model\Rule::COUPON_TYPE_AUTO); $this->requestMock->expects($this->once()) ->method('getParams') ->willReturn($requestData); @@ -202,4 +207,120 @@ public function testExecute() ->willReturn(__('%1 coupon(s) have been generated.', 2)); $this->model->execute(); } + + /** + * @covers \Magento\SalesRule\Controller\Adminhtml\Promo\Quote::execute + */ + public function testExecuteWithAutoGenerationEnabled() + { + $helperData = $this->getMockBuilder(Data::class) + ->disableOriginalConstructor() + ->getMock(); + $this->objectManagerMock->expects($this->any()) + ->method('get') + ->with(Data::class) + ->willReturn($helperData); + $requestData = [ + 'qty' => 2, + 'length' => 10, + 'rule_id' => 1 + ]; + $this->requestMock->expects($this->once()) + ->method('isAjax') + ->willReturn(true); + $ruleMock = $this->getMockBuilder(Rule::class) + ->addMethods(['getUseAutoGeneration']) + ->onlyMethods(['getId']) + ->disableOriginalConstructor() + ->getMock(); + $this->registryMock->expects($this->once()) + ->method('registry') + ->willReturn($ruleMock); + $ruleMock->expects($this->once()) + ->method('getId') + ->willReturn(1); + $ruleMock->expects($this->once()) + ->method('getUseAutoGeneration') + ->willReturn(1); + $this->requestMock->expects($this->once()) + ->method('getParams') + ->willReturn($requestData); + $requestData['quantity'] = isset($requestData['qty']) ? $requestData['qty'] : null; + $this->couponGenerationSpec->expects($this->once()) + ->method('create') + ->with(['data' => $requestData]) + ->willReturn(['some_data', 'some_data_2']); + $this->messageManager->expects($this->once()) + ->method('addSuccessMessage'); + $this->responseMock->expects($this->once()) + ->method('representJson') + ->with(); + $helperData->expects($this->once()) + ->method('jsonEncode') + ->with([ + 'messages' => __('%1 coupon(s) have been generated.', 2) + ]); + $layout = $this->getMockBuilder(Layout::class) + ->disableOriginalConstructor() + ->getMock(); + $this->view->expects($this->any()) + ->method('getLayout') + ->willReturn($layout); + $messageBlock = $this->getMockBuilder(Messages::class) + ->disableOriginalConstructor() + ->getMock(); + $layout->expects($this->once()) + ->method('initMessages'); + $layout->expects($this->once()) + ->method('getMessagesBlock') + ->willReturn($messageBlock); + $messageBlock->expects($this->once()) + ->method('getGroupedHtml') + ->willReturn(__('%1 coupon(s) have been generated.', 2)); + $this->model->execute(); + } + + /** + * @covers \Magento\SalesRule\Controller\Adminhtml\Promo\Quote::execute + */ + public function testExecuteWithCouponTypeNotAutoAndAutoGenerationNotEnabled() + { + $helperData = $this->getMockBuilder(Data::class) + ->disableOriginalConstructor() + ->getMock(); + $this->objectManagerMock->expects($this->any()) + ->method('get') + ->with(Data::class) + ->willReturn($helperData); + $this->requestMock->expects($this->once()) + ->method('isAjax') + ->willReturn(true); + $ruleMock = $this->getMockBuilder(Rule::class) + ->addMethods(['getUseAutoGeneration', 'getCouponType']) + ->onlyMethods(['getId']) + ->disableOriginalConstructor() + ->getMock(); + $this->registryMock->expects($this->once()) + ->method('registry') + ->willReturn($ruleMock); + $ruleMock->expects($this->once()) + ->method('getId') + ->willReturn(1); + $ruleMock->expects($this->once()) + ->method('getCouponType') + ->willReturn(\Magento\SalesRule\Model\Rule::COUPON_TYPE_NO_COUPON); + $ruleMock->expects($this->once()) + ->method('getUseAutoGeneration') + ->willReturn(0); + $this->responseMock->expects($this->once()) + ->method('representJson') + ->with(); + $helperData->expects($this->once()) + ->method('jsonEncode') + ->with([ + 'error' => + __('The rule coupon settings changed. Please save the rule before using auto-generation.') + ]); + $this->model->execute(); + } } diff --git a/app/code/Magento/SalesRule/i18n/en_US.csv b/app/code/Magento/SalesRule/i18n/en_US.csv index 83a5aa76ba0c8..d4f93c25dc46c 100644 --- a/app/code/Magento/SalesRule/i18n/en_US.csv +++ b/app/code/Magento/SalesRule/i18n/en_US.csv @@ -164,3 +164,4 @@ Apply,Apply "Apply to Shipping Amount","Apply to Shipping Amount" "Discard subsequent rules","Discard subsequent rules" "Default Rule Label for All Store Views","Default Rule Label for All Store Views" +"Rule is not saved with auto generate option enabled. Please save the rule and try again.", "Rule is not saved with auto generate option enabled. Please save the rule and try again." diff --git a/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php b/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php index d8645a86d2e20..51dd1d2d34f44 100644 --- a/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php +++ b/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php @@ -6,6 +6,7 @@ namespace Magento\Tax\Model\Sales\Total\Quote; +use Magento\Customer\Api\AccountManagementInterface as CustomerAccountManagement; use Magento\Customer\Api\Data\AddressInterfaceFactory as CustomerAddressFactory; use Magento\Customer\Api\Data\AddressInterface as CustomerAddress; use Magento\Customer\Api\Data\RegionInterfaceFactory as CustomerAddressRegionFactory; @@ -144,6 +145,11 @@ class CommonTaxCollector extends AbstractTotal */ private $quoteDetailsItemExtensionFactory; + /** + * @var CustomerAccountManagement + */ + private $customerAccountManagement; + /** * Class constructor * @@ -156,6 +162,8 @@ class CommonTaxCollector extends AbstractTotal * @param CustomerAddressRegionFactory $customerAddressRegionFactory * @param TaxHelper|null $taxHelper * @param QuoteDetailsItemExtensionInterfaceFactory|null $quoteDetailsItemExtensionInterfaceFactory + * @param CustomerAccountManagement|null $customerAccountManagement + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( \Magento\Tax\Model\Config $taxConfig, @@ -166,7 +174,8 @@ public function __construct( CustomerAddressFactory $customerAddressFactory, CustomerAddressRegionFactory $customerAddressRegionFactory, TaxHelper $taxHelper = null, - QuoteDetailsItemExtensionInterfaceFactory $quoteDetailsItemExtensionInterfaceFactory = null + QuoteDetailsItemExtensionInterfaceFactory $quoteDetailsItemExtensionInterfaceFactory = null, + ?CustomerAccountManagement $customerAccountManagement = null ) { $this->taxCalculationService = $taxCalculationService; $this->quoteDetailsDataObjectFactory = $quoteDetailsDataObjectFactory; @@ -178,6 +187,8 @@ public function __construct( $this->taxHelper = $taxHelper ?: ObjectManager::getInstance()->get(TaxHelper::class); $this->quoteDetailsItemExtensionFactory = $quoteDetailsItemExtensionInterfaceFactory ?: ObjectManager::getInstance()->get(QuoteDetailsItemExtensionInterfaceFactory::class); + $this->customerAccountManagement = $customerAccountManagement ?? + ObjectManager::getInstance()->get(CustomerAccountManagement::class); } /** @@ -411,7 +422,24 @@ public function mapItems( public function populateAddressData(QuoteDetailsInterface $quoteDetails, QuoteAddress $address) { $quoteDetails->setBillingAddress($this->mapAddress($address->getQuote()->getBillingAddress())); - $quoteDetails->setShippingAddress($this->mapAddress($address)); + if ($address->getAddressType() === QuoteAddress::ADDRESS_TYPE_BILLING + && !$address->getCountryId() + && $address->getQuote()->isVirtual() + && $address->getQuote()->getCustomerId() + ) { + $defaultBillingAddress = $this->customerAccountManagement->getDefaultBillingAddress( + $address->getQuote()->getCustomerId() + ); + $addressCopy = $address; + if ($defaultBillingAddress) { + $addressCopy = clone $address; + $addressCopy->importCustomerAddressData($defaultBillingAddress); + } + + $quoteDetails->setShippingAddress($this->mapAddress($addressCopy)); + } else { + $quoteDetails->setShippingAddress($this->mapAddress($address)); + } return $quoteDetails; } diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCreateTaxRuleWithTwoTaxRatesActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCreateTaxRuleWithTwoTaxRatesActionGroup.xml new file mode 100644 index 0000000000000..0232d2920370a --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminCreateTaxRuleWithTwoTaxRatesActionGroup.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCreateTaxRuleWithTwoTaxRatesActionGroup" extends="AdminCreateTaxRuleActionGroup"> + <arguments> + <argument name="taxRate2"/> + </arguments> + <click selector="{{AdminTaxRulesSection.selectTaxRate(taxRate2.code)}}" stepKey="selectTaxRate2" after="selectTaxRate"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml new file mode 100644 index 0000000000000..0ce06894ab007 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Section/StorefrontCustomerOrderViewSection.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="StorefrontCustomerOrderViewSection"> + <element name="totalsTax" type="text" selector=".totals-tax-summary .amount .price" timeout="30"/> + </section> +</sections> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontCustomerWithDefaultBillingAddressAndCartWithVirtualProductTaxTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontCustomerWithDefaultBillingAddressAndCartWithVirtualProductTaxTest.xml new file mode 100644 index 0000000000000..484135f96735d --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontCustomerWithDefaultBillingAddressAndCartWithVirtualProductTaxTest.xml @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontCustomerWithDefaultBillingAddressAndCartWithVirtualProductTaxTest"> + <annotations> + <features value="Tax"/> + <stories value="Tax Calculation in Shopping Cart"/> + <title value="Tax for quote with virtual products only should be calculated based on customer default billing address"/> + <description value="Tax for quote with virtual products only should be calculated based on customer default billing address"/> + <severity value="CRITICAL"/> + <useCaseId value="MC-41945"/> + <testCaseId value="MC-42650"/> + <group value="Tax"/> + </annotations> + <before> + <!-- Login to admin --> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + <!-- Fill in rules to display tax in the cart --> + <actionGroup ref="EditTaxConfigurationByUIActionGroup" stepKey="fillDefaultTaxForms"/> + <!-- Create tax rate for TX --> + <createData entity="TaxRateTexas" stepKey="createTaxRateTX"/> + <!-- Create tax rule --> + <actionGroup ref="AdminCreateTaxRuleWithTwoTaxRatesActionGroup" stepKey="createTaxRule"> + <argument name="taxRate" value="$$createTaxRateTX$$"/> + <argument name="taxRate2" value="US_NY_Rate_1"/> + <argument name="taxRule" value="SimpleTaxRule"/> + </actionGroup> + <!-- Create a virtual product --> + <createData entity="VirtualProduct" stepKey="createVirtualProduct"/> + <!-- Create customer --> + <createData entity="Simple_US_Customer_With_Different_Billing_Shipping_Addresses" stepKey="createCustomer"/> + </before> + <after> + <!-- Ensure tax won't be shown in the cart --> + <actionGroup ref="ChangeToDefaultTaxConfigurationUIActionGroup" stepKey="changeToDefaultTaxConfiguration"/> + <!-- Delete tax rule --> + <actionGroup ref="AdminDeleteTaxRule" stepKey="deleteTaxRule"> + <argument name="taxRuleCode" value="{{SimpleTaxRule.code}}" /> + </actionGroup> + <!-- Delete tax rate for UK --> + <deleteData createDataKey="createTaxRateTX" stepKey="deleteTaxRateUK"/> + <!-- Delete virtual product --> + <deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/> + <!-- Delete customer --> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <!-- Logout from admin --> + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> + </after> + <!-- Login with created Customer --> + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + <!-- Navigate to the product --> + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProduct2Page"> + <argument name="product" value="$$createVirtualProduct$$"/> + </actionGroup> + <!--Add to cart --> + <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="product2AddToCart"/> + <!--Click on mini cart--> + <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/> + <!--Click on view and edit cart link--> + <actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> + <waitForPageLoad stepKey="waitForViewAndEditCartToOpen"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.tax}}" stepKey="waitForOverviewVisible1" /> + <!-- Verify tax in shopping cart --> + <see selector="{{CheckoutPaymentSection.tax}}" userInput="$7.25" stepKey="verifyTaxInShoppingCartPage" /> + <!-- Navigate to payment page --> + <actionGroup ref="StorefrontOpenCheckoutPageActionGroup" stepKey="goToCheckout"/> + <waitForElementVisible selector="{{CheckoutPaymentSection.tax}}" stepKey="waitForOverviewVisible2"/> + <!-- Verify tax on payment page --> + <see selector="{{CheckoutPaymentSection.tax}}" userInput="$7.25" stepKey="verifyTaxOnPaymentPage"/> + <!-- Place order --> + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlacePurchaseOrder"/> + <!-- Navigate to order details page --> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/> + <actionGroup ref="StorefrontOpenOrderFromSuccessPageActionGroup" stepKey="openOrderFromSuccessPage"> + <argument name="orderNumber" value="{$grabOrderNumber}"/> + </actionGroup> + <!-- Verify tax on order view page --> + <see selector="{{StorefrontCustomerOrderViewSection.totalsTax}}" userInput="$7.25" stepKey="verifyTaxOnOrderViewPage"/> + </test> +</tests> diff --git a/app/code/Magento/Theme/ViewModel/Block/SessionConfig.php b/app/code/Magento/Theme/ViewModel/Block/SessionConfig.php new file mode 100644 index 0000000000000..d697c0a61b448 --- /dev/null +++ b/app/code/Magento/Theme/ViewModel/Block/SessionConfig.php @@ -0,0 +1,45 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Theme\ViewModel\Block; + +use Magento\Framework\Session\Config\ConfigInterface; +use Magento\Framework\View\Element\Block\ArgumentInterface; + +/** + * Provide cookie configuration + */ +class SessionConfig implements ArgumentInterface +{ + /** + * Session config + * + * @var ConfigInterface + */ + private $sessionConfig; + + /** + * Constructor + * + * @param ConfigInterface $sessionConfig + */ + public function __construct( + ConfigInterface $sessionConfig + ) { + $this->sessionConfig = $sessionConfig; + } + /** + * Get session.cookie_secure + * + * @return bool + * @SuppressWarnings(PHPMD.BooleanGetMethodName) + */ + public function getCookieSecure(): bool + { + return $this->sessionConfig->getCookieSecure(); + } +} diff --git a/app/code/Magento/Theme/view/frontend/layout/default.xml b/app/code/Magento/Theme/view/frontend/layout/default.xml index 933d4e588787c..321e6938388ef 100644 --- a/app/code/Magento/Theme/view/frontend/layout/default.xml +++ b/app/code/Magento/Theme/view/frontend/layout/default.xml @@ -12,7 +12,11 @@ <block name="require.js" class="Magento\Framework\View\Element\Template" template="Magento_Theme::page/js/require_js.phtml" /> <referenceContainer name="after.body.start"> <block class="Magento\RequireJs\Block\Html\Head\Config" name="requirejs-config"/> - <block class="Magento\Framework\View\Element\Js\Cookie" name="js_cookies" template="Magento_Theme::js/cookie.phtml"/> + <block class="Magento\Framework\View\Element\Js\Cookie" name="js_cookies" template="Magento_Theme::js/cookie.phtml"> + <arguments> + <argument name="session_config" xsi:type="object">Magento\Theme\ViewModel\Block\SessionConfig</argument> + </arguments> + </block> <block class="Magento\Theme\Block\Html\Notices" name="global_notices" template="Magento_Theme::html/notices.phtml"/> </referenceContainer> <referenceBlock name="top.links"> diff --git a/app/code/Magento/Theme/view/frontend/templates/js/cookie.phtml b/app/code/Magento/Theme/view/frontend/templates/js/cookie.phtml index 7ecfd18d0d3b0..10cf6957fa4c3 100644 --- a/app/code/Magento/Theme/view/frontend/templates/js/cookie.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/js/cookie.phtml @@ -18,7 +18,7 @@ "expires": null, "path": "<?= $block->escapeJs($block->getPath()) ?>", "domain": "<?= $block->escapeJs($block->getDomain()) ?>", - "secure": false, + "secure": <?= $block->getSessionConfig()->getCookieSecure() ? 'true' : 'false'; ?>, "lifetime": "<?= $block->escapeJs($block->getLifetime()) ?>" } } diff --git a/app/code/Magento/Ui/view/base/web/js/lib/core/collection.js b/app/code/Magento/Ui/view/base/web/js/lib/core/collection.js index 33acba6103b10..ba6489a0291b8 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/core/collection.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/core/collection.js @@ -21,7 +21,85 @@ define([ * @returns {Array} */ function compact(container) { - return container.filter(utils.isObject); + return _.values(container).filter(utils.isObject); + } + + /** + * Defines index of an item in a specified container. + * + * @param {*} item - Item whose index should be defined. + * @param {Array} container - Container upon which to perform search. + * @returns {Number} + */ + function _findIndex(item, container) { + var index = _.findKey(container, function (value) { + return value === item; + }); + + if (typeof index === 'undefined') { + index = _.findKey(container, function (value) { + return value && value.name === item; + }); + } + + return typeof index === 'undefined' ? -1 : index; + } + + /** + * Inserts specified item into container at a specified position. + * + * @param {*} item - Item to be inserted into container. + * @param {Array} container - Container of items. + * @param {*} [position=-1] - Position at which item should be inserted. + * Position can represent: + * - specific index in container + * - item which might already be present in container + * - structure with one of these properties: after, before + * @returns {Boolean|*} + * - true if element has changed its' position + * - false if nothing has changed + * - inserted value if it wasn't present in container + */ + function _insertAt(item, container, position) { + var currentIndex = _findIndex(item, container), + newIndex, + target; + + if (typeof position === 'undefined') { + position = -1; + } else if (typeof position === 'string') { + position = isNaN(+position) ? position : +position; + } + + newIndex = position; + + if (~currentIndex) { + target = container.splice(currentIndex, 1)[0]; + + if (typeof item === 'string') { + item = target; + } + } + + if (typeof position !== 'number') { + target = position.after || position.before || position; + + newIndex = _findIndex(target, container); + + if (~newIndex && (position.after || newIndex >= currentIndex)) { + newIndex++; + } + } + + if (newIndex < 0) { + newIndex += container.length + 1; + } + + container[newIndex] ? + container.splice(newIndex, 0, item) : + container[newIndex] = item; + + return !~currentIndex ? item : currentIndex !== newIndex; } return Element.extend({ @@ -90,8 +168,8 @@ define([ elems.map(function (item) { return item.elem ? - utils.insert(item.elem, container, item.position) : - utils.insert(item, container, position); + _insertAt(item.elem, container, item.position) : + _insertAt(item, container, position); }).forEach(function (item) { if (item === true) { update = true; @@ -257,9 +335,11 @@ define([ * @param {Object} elem - Element to insert. */ _insert: function (elem) { - var index = this._elems.indexOf(elem.name); + var index = _.findKey(this._elems, function (value) { + return value === elem.name; + }); - if (~index) { + if (typeof index !== 'undefined') { this._elems[index] = elem; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/ProductSearchTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/ProductSearchTest.php new file mode 100644 index 0000000000000..4acc2d21cde02 --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogGraphQl/ProductSearchTest.php @@ -0,0 +1,84 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\GraphQl\CatalogGraphQl; + +use Magento\GraphQl\GetCustomerAuthenticationHeader; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\ObjectManager; +use Magento\TestFramework\TestCase\GraphQlAbstract; + +/** + * Test class to verify product search, used for GraphQL resolver + * for configurable product returns only visible products. + */ +class ProductSearchTest extends GraphQlAbstract +{ + /** + * @var ObjectManager|null + */ + private $objectManager; + + /** + * @var GetCustomerAuthenticationHeader + */ + private $getCustomerAuthenticationHeader; + + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->getCustomerAuthenticationHeader = $this->objectManager->get(GetCustomerAuthenticationHeader::class); + } + + /** + * Test for checking if graphQL query fpr configurable product returns + * expected visible items + * + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_products_with_different_super_attribute.php + */ + public function testCheckIfConfigurableProductVisibilityReturnsExpectedItem(): void + { + $productName = 'Configurable Product'; + $productSku = 'configurable'; + $query = $this->getProductSearchQuery($productName, $productSku); + + $response = $this->graphQlQuery($query); + + $this->assertNotEmpty($response['products']); + $this->assertEquals(1, $response['products']['total_count']); + $this->assertNotEmpty($response['products']['items']); + $this->assertEquals($productName, $response['products']['items'][0]['name']); + $this->assertEquals($productSku, $response['products']['items'][0]['sku']); + } + + /** + * Get a query which user filter for product sku and search by product name + * + * @param string $productName + * @param string $productSku + * @return string + */ + private function getProductSearchQuery(string $productName, string $productSku): string + { + return <<<QUERY +{ + products(filter: {sku: {eq: "{$productSku}"}}, search: "$productName", sort: {}, pageSize: 200, currentPage: 1) { + total_count + page_info { + total_pages + current_page + page_size + } + items { + name + sku + } + } +} +QUERY; + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductMultipleStoreViewTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductMultipleStoreViewTest.php index e8d789f6d35e4..62fa74ab2ffbf 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductMultipleStoreViewTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableProductMultipleStoreViewTest.php @@ -36,6 +36,42 @@ public function testConfigurableProductAssignedToOneWebsite() self::assertContains('Option 2', $secondWebsiteVariants[1]['attributes'][0]); } + /** + * @magentoApiDataFixture Magento/ConfigurableProduct/_files/configurable_product_with_children_on_different_websites.php + * @dataProvider childrenAssignedToDifferentWebsitesDataProvider + * @param string $store + * @param string $childSku + * @param string $attributeLabel + */ + public function testConfigurableProductWithChildrenAssignedToDifferentWebsites( + string $store, + string $childSku, + string $attributeLabel + ) { + $headers = ['Store' => $store]; + $query = $this->getQuery('configurable'); + $response = $this->graphQlQuery($query, [], '', $headers); + self::assertCount(1, $response['products']['items']); + $product = $response['products']['items'][0]; + self::assertCount(1, $product['variants']); + $variant = $response['products']['items'][0]['variants'][0]; + self::assertEquals($childSku, $variant['product']['sku']); + self::assertCount(1, $variant['attributes']); + $attribute = $variant['attributes'][0]; + self::assertEquals($attributeLabel, $attribute['label']); + } + + /** + * @return array + */ + public function childrenAssignedToDifferentWebsitesDataProvider(): array + { + return [ + ['default', 'simple_option_2', 'Option 2'], + ['fixture_second_store', 'simple_option_1', 'Option 1'], + ]; + } + /** * @param string $sku * @return string diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/SkuTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/SkuTest.php index f557919897869..d70f1404b33d6 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/SkuTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/SkuTest.php @@ -49,15 +49,14 @@ public function testGenerateUniqueLongSku() ); $product = $repository->get('simple'); $product->setSku('0123456789012345678901234567890123456789012345678901234567890123'); - + $product->save(); /** @var \Magento\Catalog\Model\Product\Copier $copier */ $copier = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( \Magento\Catalog\Model\Product\Copier::class ); - $copier->copy($product); + $duplicate = $copier->copy($product); $this->assertEquals('0123456789012345678901234567890123456789012345678901234567890123', $product->getSku()); - $product->getResource()->getAttribute('sku')->getBackend()->beforeSave($product); - $this->assertEquals('01234567890123456789012345678901234567890123456789012345678901-1', $product->getSku()); + $this->assertEquals('01234567890123456789012345678901234567890123456789012345678901-1', $duplicate->getSku()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceTest.php index 66e60a24e0a07..7ab9a7a50186f 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceTest.php @@ -133,4 +133,20 @@ public function testGetMinPriceForComposite(): void $product = $collection->getFirstItem(); $this->assertEquals(20, $product->getData('min_price')); } + + /** + * @magentoDbIsolation disabled + * @magentoDataFixture Magento/Catalog/_files/simple_product_with_tier_price_equal_zero.php + */ + public function testGetMinPriceWhenTierPriceEqualZero() + { + $product = $this->productRepository->get('simple-2'); + $collection = Bootstrap::getObjectManager()->create(Collection::class); + $collection->addIdFilter($product->getId()); + $collection->addPriceData(0); + $collection->load(); + $product = $collection->getFirstItem(); + $this->assertEquals(0, $product->getData('tier_price')); + $this->assertEquals(0, $product->getData('min_price')); + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php index ceb3a2c7a94b2..d8275d78bfb79 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ProductTest.php @@ -10,6 +10,7 @@ use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Copier; use Magento\Catalog\Model\Product\Visibility; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Exception\CouldNotSaveException; @@ -19,6 +20,7 @@ use Magento\Framework\Exception\StateException; use Magento\Framework\Math\Random; use Magento\Framework\ObjectManagerInterface; +use Magento\Store\Model\Store; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\ObjectManager; @@ -252,30 +254,71 @@ protected function _copyFileToBaseTmpMediaPath($sourceFile) } /** - * Test duplicate method + * Test Duplicate of product * + * Product assigned to default and custom scope is used. After duplication the copied product + * should retain store view specific data + * + * @magentoDataFixture Magento/Catalog/_files/product_multistore_different_short_description.php * @magentoAppIsolation enabled * @magentoAppArea adminhtml + * @magentoDbIsolation disabled */ public function testDuplicate() { - $this->_model = $this->productRepository->get('simple'); - - // fixture - /** @var \Magento\Catalog\Model\Product\Copier $copier */ + $fixtureProductSku = 'simple-different-short-description'; + $fixtureCustomStoreCode = 'fixturestore'; + $defaultStoreId = Store::DEFAULT_STORE_ID; + /** @var \Magento\Store\Api\StoreRepositoryInterface $storeRepository */ + $storeRepository = $this->objectManager->create(\Magento\Store\Api\StoreRepositoryInterface::class); + $customStoreId = $storeRepository->get($fixtureCustomStoreCode)->getId(); + $defaultScopeProduct = $this->productRepository->get($fixtureProductSku, true, $defaultStoreId); + $customScopeProduct = $this->productRepository->get($fixtureProductSku, true, $customStoreId); + /** @var Copier $copier */ $copier = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - \Magento\Catalog\Model\Product\Copier::class + Copier::class ); - $duplicate = $copier->copy($this->_model); + $duplicate = $copier->copy($defaultScopeProduct); + + /* Fetch duplicate after cloning */ + $defaultScopeDuplicate = $this->productRepository->getById($duplicate->getId(), true, $defaultStoreId); + $customScopeDuplicate = $this->productRepository->getById($duplicate->getId(), true, $customStoreId); + try { - $this->assertNotEmpty($duplicate->getId()); - $this->assertNotEquals($duplicate->getId(), $this->_model->getId()); - $this->assertNotEquals($duplicate->getSku(), $this->_model->getSku()); + $this->assertNotEquals( + $customScopeDuplicate->getId(), $customScopeProduct->getId(), + 'Duplicate product Id should not equal to source product Id' + ); + $this->assertNotEquals( + $customScopeDuplicate->getSku(), $customScopeProduct->getSku(), + 'Duplicate product SKU should not equal to source product SKU' + ); + $this->assertNotEquals( + $customScopeDuplicate->getShortDescription(), $defaultScopeDuplicate->getShortDescription(), + 'Short description of the duplicated product on custom scope should not equal to ' . + 'duplicate product description on default scope' + ); + $this->assertEquals( + $customScopeProduct->getShortDescription(), $customScopeDuplicate->getShortDescription(), + 'Short description of the duplicated product on custom scope should equal to ' . + 'source product description on custom scope' + ); + $this->assertEquals( + $customScopeProduct->getStoreId(), $customScopeDuplicate->getStoreId(), + 'Store Id of the duplicated product on custom scope should equal to ' . + 'store Id of source product on custom scope' + ); $this->assertEquals( - Status::STATUS_DISABLED, - $duplicate->getStatus() + $defaultScopeProduct->getStoreId(), $defaultScopeDuplicate->getStoreId(), + 'Store Id of the duplicated product on default scope should equal to ' . + 'store Id of source product on default scope' ); - $this->assertEquals(\Magento\Store\Model\Store::DEFAULT_STORE_ID, $duplicate->getStoreId()); + + $this->assertEquals( + Status::STATUS_DISABLED, $defaultScopeDuplicate->getStatus(), + 'Duplicate should be disabled' + ); + $this->_undo($duplicate); } catch (\Exception $e) { $this->_undo($duplicate); @@ -293,9 +336,9 @@ public function testDuplicateSkuGeneration() $this->_model = $this->productRepository->get('simple'); $this->assertEquals('simple', $this->_model->getSku()); - /** @var \Magento\Catalog\Model\Product\Copier $copier */ + /** @var Copier $copier */ $copier = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - \Magento\Catalog\Model\Product\Copier::class + Copier::class ); $duplicate = $copier->copy($this->_model); $this->assertEquals('simple-5', $duplicate->getSku()); @@ -311,7 +354,7 @@ protected function _undo($duplicate) \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( \Magento\Store\Model\StoreManagerInterface::class )->getStore()->setId( - \Magento\Store\Model\Store::DEFAULT_STORE_ID + Store::DEFAULT_STORE_ID ); $duplicate->delete(); } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php index 552dd3fbbfdd5..885a7dff06633 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/CollectionTest.php @@ -206,26 +206,23 @@ public function testGetProductsWithTierPrice() /** * Test addAttributeToSort() with attribute 'is_saleable' works properly on frontend. * - * @dataProvider addAttributeToSortDataProvider + * @dataProvider addIsSaleableAttributeToSortDataProvider * @magentoDataFixture Magento/Catalog/_files/multiple_products_with_non_saleable_product.php * @magentoConfigFixture current_store cataloginventory/options/show_out_of_stock 1 * @magentoAppIsolation enabled * @magentoAppArea frontend */ - public function testAddAttributeToSort(string $productSku, string $order) + public function testAddIsSaleableAttributeToSort(string $productSku, string $order) { - /** @var Collection $productCollection */ $this->collection->addAttributeToSort('is_saleable', $order); - self::assertEquals(2, $this->collection->count()); - self::assertSame($productSku, $this->collection->getFirstItem()->getSku()); + $this->assertEquals(2, $this->collection->count()); + $this->assertEquals($productSku, $this->collection->getFirstItem()->getSku()); } /** - * Provide test data for testAddAttributeToSort(). - * * @return array */ - public function addAttributeToSortDataProvider() + public function addIsSaleableAttributeToSortDataProvider(): array { return [ [ @@ -239,6 +236,42 @@ public function addAttributeToSortDataProvider() ]; } + /** + * Test addAttributeToSort() with attribute 'price' works properly on frontend. + * + * @dataProvider addPriceAttributeToSortDataProvider + * @magentoDataFixture Magento/Catalog/_files/product_simple.php + * @magentoDataFixture Magento/Catalog/_files/simple_product_with_tier_price_equal_zero.php + * @magentoAppIsolation enabled + * @magentoDbIsolation disabled + * @magentoAppArea frontend + */ + public function testAddPriceAttributeToSort(string $productSku, string $order) + { + $this->processor->getIndexer()->reindexAll(); + $this->collection->setStoreId(1); + $this->collection->addAttributeToSort('price', $order); + $this->assertEquals(2, $this->collection->count()); + $this->assertEquals($productSku, $this->collection->getFirstItem()->getSku()); + } + + /** + * @return array + */ + public function addPriceAttributeToSortDataProvider(): array + { + return [ + [ + 'product_sku' => 'simple', + 'order' => Collection::SORT_ORDER_DESC, + ], + [ + 'product_sku' => 'simple-2', + 'order' => Collection::SORT_ORDER_ASC, + ] + ]; + } + /** * Checks a case if table for join specified as an array. * diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_equal_zero.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_equal_zero.php new file mode 100644 index 0000000000000..f287223954c1b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_equal_zero.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductTierPriceExtension; +use Magento\Catalog\Api\Data\ProductTierPriceInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_without_custom_options.php'); + +$objectManager = Bootstrap::getObjectManager(); + +$adminWebsite = $objectManager->get(WebsiteRepositoryInterface::class) + ->get('admin'); +$tierPriceExtensionAttributes = $objectManager->create(ProductTierPriceExtension::class) + ->setWebsiteId($adminWebsite->getId()); +$tierPrices = []; +$tierPrice = $objectManager->create(ProductTierPriceInterface::class) + ->setCustomerGroupId(0) + ->setQty(1) + ->setValue(0) + ->setExtensionAttributes($tierPriceExtensionAttributes); +$tierPrices[] = $tierPrice; + +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$product = $productRepository->get('simple-2', false, null, true); +$product->setTierPrices($tierPrices); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_equal_zero_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_equal_zero_rollback.php new file mode 100644 index 0000000000000..c98913e63d367 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/simple_product_with_tier_price_equal_zero_rollback.php @@ -0,0 +1,10 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_without_custom_options_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductMultipleStoresTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductMultipleStoresTest.php index 892941162f588..17ca3d5b5b0ca 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductMultipleStoresTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductMultipleStoresTest.php @@ -16,7 +16,7 @@ * Integration test for \Magento\CatalogImportExport\Model\Import\Product class. * * @magentoAppIsolation enabled - * @magentoDbIsolation enabled + * @magentoDbIsolation disabled * @magentoAppArea adminhtml * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_reindex_schedule.php * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php @@ -27,7 +27,6 @@ class ProductMultipleStoresTest extends ProductTestBase /** * @magentoDataFixture Magento/Store/_files/website.php * @magentoDataFixture Magento/Store/_files/core_fixturestore.php - * @magentoDbIsolation disabled */ public function testProductWithMultipleStoresInDifferentBunches() { @@ -124,6 +123,7 @@ function (ProductInterface $item) { * Test import product into multistore system when media is disabled. * * @magentoDataFixture Magento/CatalogImportExport/Model/Import/_files/custom_category_store_media_disabled.php + * @magentoDbIsolation enabled * @return void */ public function testProductsWithMultipleStoresWhenMediaIsDisabled(): void @@ -165,7 +165,6 @@ function ($value) { * @magentoDataFixture Magento/Store/_files/core_fixturestore.php * @magentoDataFixture Magento/Catalog/Model/Layer/Filter/_files/attribute_with_option.php * @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_attribute.php - * @magentoDbIsolation disabled */ public function testProductsWithMultipleStores() { diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductOptionsTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductOptionsTest.php index b40c5a2a476b2..b3ce40437c53c 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductOptionsTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductOptionsTest.php @@ -16,6 +16,7 @@ * Integration test for \Magento\CatalogImportExport\Model\Import\Product class. * * @magentoAppArea adminhtml + * @magentoDbIsolation disabled * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_reindex_schedule.php * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php */ @@ -126,6 +127,12 @@ public function testSaveCustomOptions(string $importFile, string $sku, int $expe $customOptionValues = $this->getCustomOptionValues($sku); $this->createImportModel($pathToFile)->importData(); $this->assertEquals($customOptionValues, $this->getCustomOptionValues($sku)); + + // Cleanup imported products + try { + $this->productRepository->delete($product); + } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { + } } /** diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductUrlKeyTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductUrlKeyTest.php index b050368b76239..a69603aca1e74 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductUrlKeyTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/Import/ProductTest/ProductUrlKeyTest.php @@ -18,6 +18,7 @@ /** * Integration test for \Magento\CatalogImportExport\Model\Import\Product class. * + * @magentoDbIsolation disabled * @magentoAppArea adminhtml * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_reindex_schedule.php * @magentoDataFixtureBeforeTransaction Magento/Catalog/_files/enable_catalog_product_reindex_schedule.php diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/configurable_product_with_children_on_different_websites.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/configurable_product_with_children_on_different_websites.php new file mode 100644 index 0000000000000..b13f29614a5ec --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/configurable_product_with_children_on_different_websites.php @@ -0,0 +1,95 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Catalog\Api\Data\ProductExtensionFactory; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Product\Attribute\Source\Status; +use Magento\Catalog\Model\Product\Type as ProductType; +use Magento\Catalog\Model\Product\Visibility; +use Magento\Catalog\Model\ProductFactory; +use Magento\ConfigurableProduct\Helper\Product\Options\Factory; +use Magento\ConfigurableProduct\Model\Product\Type\Configurable; +use Magento\Store\Api\WebsiteRepositoryInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +Resolver::getInstance()->requireDataFixture('Magento/Store/_files/second_website_with_two_stores.php'); +Resolver::getInstance()->requireDataFixture('Magento/ConfigurableProduct/_files/configurable_attribute.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductAttributeRepositoryInterface $productAttributeRepository */ +$productAttributeRepository = $objectManager->get(ProductAttributeRepositoryInterface::class); +$attribute = $productAttributeRepository->get('test_configurable'); +$options = $attribute->getOptions(); +/** @var WebsiteRepositoryInterface $websiteRepository */ +$websiteRepository = $objectManager->get(WebsiteRepositoryInterface::class); +$baseWebsite = $websiteRepository->get('base'); +$secondWebsite = $websiteRepository->get('test'); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$productRepository->cleanCache(); +/** @var ProductFactory $productFactory */ +$productFactory = $objectManager->get(ProductFactory::class); +$attributeValues = []; +$associatedProductIds = []; +$rootCategoryId = $baseWebsite->getDefaultStore()->getRootCategoryId(); +array_shift($options); + +foreach ($options as $key => $option) { + $product = $productFactory->create(); + $product->setTypeId(ProductType::TYPE_SIMPLE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setWebsiteIds([$key % 2 ? $baseWebsite->getId() : $secondWebsite->getId()]) + ->setName('Configurable Option ' . $option->getLabel()) + ->setSku(strtolower(str_replace(' ', '_', 'simple ' . $option->getLabel()))) + ->setPrice(150) + ->setTestConfigurable($option->getValue()) + ->setVisibility(Visibility::VISIBILITY_NOT_VISIBLE) + ->setStatus(Status::STATUS_ENABLED) + ->setCategoryIds([$rootCategoryId]) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]); + $product = $productRepository->save($product); + + $attributeValues[] = [ + 'label' => 'test', + 'attribute_id' => $attribute->getId(), + 'value_index' => $option->getValue(), + ]; + $associatedProductIds[] = $product->getId(); +} +/** @var Factory $optionsFactory */ +$optionsFactory = $objectManager->get(Factory::class); +$configurableAttributesData = [ + [ + 'attribute_id' => $attribute->getId(), + 'code' => $attribute->getAttributeCode(), + 'label' => $attribute->getStoreLabel(), + 'position' => '0', + 'values' => $attributeValues, + ], +]; +$configurableOptions = $optionsFactory->create($configurableAttributesData); + +$product = $productFactory->create(); +/** @var ProductExtensionFactory $extensionAttributesFactory */ +$extensionAttributesFactory = $objectManager->get(ProductExtensionFactory::class); +$extensionConfigurableAttributes = $product->getExtensionAttributes() ?: $extensionAttributesFactory->create(); +$extensionConfigurableAttributes->setConfigurableProductOptions($configurableOptions); +$extensionConfigurableAttributes->setConfigurableProductLinks($associatedProductIds); +$product->setExtensionAttributes($extensionConfigurableAttributes); + +$product->setTypeId(Configurable::TYPE_CODE) + ->setAttributeSetId($product->getDefaultAttributeSetId()) + ->setWebsiteIds([$baseWebsite->getId(), $secondWebsite->getId()]) + ->setName('Configurable Product') + ->setSku('configurable') + ->setVisibility(Visibility::VISIBILITY_BOTH) + ->setStatus(Status::STATUS_ENABLED) + ->setCategoryIds([$rootCategoryId]) + ->setStockData(['use_config_manage_stock' => 1, 'is_in_stock' => 1]); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/configurable_product_with_children_on_different_websites_rollback.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/configurable_product_with_children_on_different_websites_rollback.php new file mode 100644 index 0000000000000..2633abdf167f5 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/configurable_product_with_children_on_different_websites_rollback.php @@ -0,0 +1,18 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\ConfigurableProduct\Model\DeleteConfigurableProduct; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\Workaround\Override\Fixture\Resolver; + +$objectManager = Bootstrap::getObjectManager(); +/** @var DeleteConfigurableProduct $deleteConfigurableProduct */ +$deleteConfigurableProduct = $objectManager->get(DeleteConfigurableProduct::class); +$deleteConfigurableProduct->execute('configurable'); + +Resolver::getInstance()->requireDataFixture('Magento/Store/_files/second_website_with_two_stores_rollback.php'); +Resolver::getInstance()->requireDataFixture('Magento/ConfigurableProduct/_files/configurable_attribute_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/Elasticsearch/Model/Indexer/ReindexAllTest.php b/dev/tests/integration/testsuite/Magento/Elasticsearch/Model/Indexer/ReindexAllTest.php index 6df4d8fbb2d92..e344b61b3826f 100644 --- a/dev/tests/integration/testsuite/Magento/Elasticsearch/Model/Indexer/ReindexAllTest.php +++ b/dev/tests/integration/testsuite/Magento/Elasticsearch/Model/Indexer/ReindexAllTest.php @@ -174,17 +174,30 @@ public function testSortCaseSensitive(): void * * @magentoConfigFixture current_store catalog/search/elasticsearch_index_prefix indexerhandlertest_configurable * @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_products.php + * @magentoDataFixture Magento/Catalog/_files/products.php + * @dataProvider searchSpecificProductDataProvider + * @param string $searchName + * @param string $sku + * @param int $expectedCount */ - public function testSearchSpecificProduct() + public function testSearchSpecificProduct(string $searchName, string $sku, int $expectedCount) { $this->reindexAll(); - $result = $this->searchByName('12345'); - self::assertCount(1, $result); + $result = $this->searchByName($searchName); + self::assertCount($expectedCount, $result); - $specificProduct = $this->productRepository->get('configurable_12345'); + $specificProduct = $this->productRepository->get($sku); self::assertEquals($specificProduct->getId(), $result[0]['_id']); } + public function searchSpecificProductDataProvider(): array + { + return [ + 'search by numeric name' => ['12345', 'configurable_12345', 1], + 'search by name with diacritics' => ['Cùstöm Dèsign', 'custom-design-simple-product', 1], + ]; + } + /** * @param string $text * @return array diff --git a/dev/tests/integration/testsuite/Magento/Framework/DB/DataConverter/DataConverterTest.php b/dev/tests/integration/testsuite/Magento/Framework/DB/DataConverter/DataConverterTest.php index 9ffdd6993644f..5f64b81802656 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/DB/DataConverter/DataConverterTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/DB/DataConverter/DataConverterTest.php @@ -3,9 +3,14 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + namespace Magento\Framework\DB\DataConverter; +use Magento\Framework\App\ResourceConnection; +use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Adapter\Pdo\Mysql; +use Magento\Framework\DB\Ddl\Table; +use Magento\Framework\DB\FieldDataConversionException; use Magento\Framework\DB\FieldDataConverter; use Magento\Framework\DB\Select; use Magento\Framework\DB\Select\QueryModifierInterface; @@ -14,11 +19,13 @@ use Magento\Framework\DB\Query\Generator; use Magento\Framework\DB\Query\BatchIterator; use Magento\Framework\ObjectManagerInterface; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; -class DataConverterTest extends \PHPUnit\Framework\TestCase +class DataConverterTest extends TestCase { /** - * @var InQueryModifier|\PHPUnit\Framework\MockObject\MockObject + * @var InQueryModifier|MockObject */ private $queryModifierMock; @@ -28,22 +35,22 @@ class DataConverterTest extends \PHPUnit\Framework\TestCase private $dataConverter; /** - * @var BatchIterator|\PHPUnit\Framework\MockObject\MockObject + * @var BatchIterator|MockObject */ private $iteratorMock; /** - * @var Generator|\PHPUnit\Framework\MockObject\MockObject + * @var Generator|MockObject */ private $queryGeneratorMock; /** - * @var Select|\PHPUnit\Framework\MockObject\MockObject + * @var Select|MockObject */ private $selectByRangeMock; /** - * @var Mysql|\PHPUnit\Framework\MockObject\MockObject + * @var Mysql|MockObject */ private $adapterMock; @@ -114,18 +121,22 @@ function () use (&$iterationComplete) { $this->adapterMock = $this->getMockBuilder(Mysql::class) ->disableOriginalConstructor() - ->setMethods(['fetchPairs', 'quoteInto', 'update']) + ->setMethods(['fetchPairs', 'fetchAll', 'quoteInto', 'update', 'prepareSqlCondition']) ->getMock(); $this->adapterMock->expects($this->any()) ->method('quoteInto') ->willReturn('field=value'); + $batchIteratorFactory = $this->createMock(\Magento\Framework\DB\Query\BatchRangeIteratorFactory::class); + $batchIteratorFactory->method('create')->willReturn($this->iteratorMock); + $this->fieldDataConverter = $this->objectManager->create( FieldDataConverter::class, [ 'queryGenerator' => $this->queryGeneratorMock, - 'dataConverter' => $this->dataConverter + 'dataConverter' => $this->dataConverter, + 'batchIteratorFactory' => $batchIteratorFactory, ] ); } @@ -136,7 +147,7 @@ function () use (&$iterationComplete) { */ public function testDataConvertErrorReporting() { - $this->expectException(\Magento\Framework\DB\FieldDataConversionException::class); + $this->expectException(FieldDataConversionException::class); $this->expectExceptionMessage('Error converting field `value` in table `table` where `id`=2 using'); $rows = [ @@ -179,4 +190,158 @@ public function testAlreadyConvertedDataSkipped() $this->fieldDataConverter->convert($this->adapterMock, 'table', 'id', 'value', $this->queryModifierMock); } + + public function testAlreadyConvertedDataSkippedWithCompositeIdentifier(): void + { + $rows = [ + [ + 'key_one' => 1, + 'key_two' => 1, + 'value' => '[]', + ], + [ + 'key_one' => 1, + 'key_two' => 2, + 'value' => '{}', + ], + [ + 'key_one' => 3, + 'key_two' => 3, + 'value' => 'N;', + ], + [ + 'key_one' => 4, + 'key_two' => 1, + 'value' => '{"valid": "json value"}', + ] + ]; + + $this->adapterMock->expects($this->any()) + ->method('prepareSqlCondition') + ->willReturnCallback( + function ($column, $value) { + return "$column = $value"; + } + ); + + $this->adapterMock->expects($this->any()) + ->method('fetchAll') + ->with($this->selectByRangeMock) + ->willReturn($rows); + + $this->adapterMock->expects($this->once()) + ->method('update') + ->with('table', ['value' => 'null'], 'key_one = 3 AND key_two = 3'); + + $this->fieldDataConverter->convert($this->adapterMock, 'table', 'id1,id2', 'value', $this->queryModifierMock); + } + + /** + * @magentoDbIsolation disabled + * @magentoDataFixture createFixtureTable + */ + public function testTableWithCompositeIdentifier(): void + { + $resource = Bootstrap::getObjectManager()->get(ResourceConnection::class); + $tableName = 'test_fixture_table'; + $keyOneValues = range(1, 9); + $keyTwoValues = [3, 6, 9]; + $records = []; + foreach ($keyOneValues as $keyOneValue) { + foreach (array_slice($keyTwoValues, 0, rand(1, 3)) as $keyTwoValue) { + $records[] = [ + 'key_one' => $keyOneValue, + 'key_two' => $keyTwoValue, + // phpcs:ignore + 'value' => serialize(['key_one' => $keyOneValue, 'key_two' => $keyTwoValue]), + ]; + } + } + // phpcs:ignore + $repeatedVal = serialize([]); + $records[] = [ + 'key_one' => 10, + 'key_two' => 3, + 'value' => $repeatedVal, + ]; + $records[] = [ + 'key_one' => 10, + 'key_two' => 6, + 'value' => $repeatedVal, + ]; + $records[] = [ + 'key_one' => 11, + 'key_two' => 6, + 'value' => $repeatedVal, + ]; + + $resource->getConnection()->insertMultiple($tableName, $records); + + $expected = []; + + foreach ($records as $record) { + $record['value'] = $this->dataConverter->convert($record['value']); + $expected[] = $record; + } + + $batchSize = 5; + $fieldDataConverter = $this->objectManager->create( + FieldDataConverter::class, + [ + 'dataConverter' => $this->dataConverter, + 'envBatchSize' => $batchSize + ] + ); + $fieldDataConverter->convert($resource->getConnection(), $tableName, 'key_one,key_two', 'value'); + $actual = $resource->getConnection()->fetchAll( + $resource->getConnection()->select()->from($tableName) + ); + $this->assertEquals($expected, $actual, json_encode($records)); + } + + public static function createFixtureTable(): void + { + $resource = Bootstrap::getObjectManager()->get(ResourceConnection::class); + $tableName = 'test_fixture_table'; + $table = $resource->getConnection() + ->newTable( + $tableName + ) + ->addColumn( + 'key_one', + Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false] + ) + ->addColumn( + 'key_two', + Table::TYPE_INTEGER, + null, + ['unsigned' => true, 'nullable' => false] + ) + ->addColumn( + 'value', + Table::TYPE_TEXT, + null, + ['nullable' => true] + ) + ->addIndex( + $tableName . '_index_key_one_key_two', + [ + 'key_one', + 'key_two', + ], + [ + 'type' => AdapterInterface::INDEX_TYPE_PRIMARY + ] + ); + $resource->getConnection()->createTable($table); + } + + public static function createFixtureTableRollback(): void + { + $resource = Bootstrap::getObjectManager()->get(ResourceConnection::class); + $tableName = 'test_fixture_table'; + $resource->getConnection()->dropTable($tableName); + } } diff --git a/lib/internal/Magento/Framework/Amqp/Queue.php b/lib/internal/Magento/Framework/Amqp/Queue.php index 84689c294af0c..7d950f70e557e 100644 --- a/lib/internal/Magento/Framework/Amqp/Queue.php +++ b/lib/internal/Magento/Framework/Amqp/Queue.php @@ -14,8 +14,6 @@ use Psr\Log\LoggerInterface; /** - * Class Queue - * * @api * @since 103.0.0 */ @@ -41,6 +39,13 @@ class Queue implements QueueInterface */ private $logger; + /** + * The prefetch value is used to specify how many messages that are being sent to the consumer at the same time. + * @see https://www.rabbitmq.com/consumer-prefetch.html + * @var int + */ + private $prefetchCount; + /** * Initialize dependencies. * @@ -48,17 +53,20 @@ class Queue implements QueueInterface * @param EnvelopeFactory $envelopeFactory * @param string $queueName * @param LoggerInterface $logger + * @param int $prefetchCount */ public function __construct( Config $amqpConfig, EnvelopeFactory $envelopeFactory, $queueName, - LoggerInterface $logger + LoggerInterface $logger, + $prefetchCount = 100 ) { $this->amqpConfig = $amqpConfig; $this->queueName = $queueName; $this->envelopeFactory = $envelopeFactory; $this->logger = $logger; + $this->prefetchCount = (int)$prefetchCount; } /** @@ -144,6 +152,7 @@ public function subscribe($callback) $channel = $this->amqpConfig->getChannel(); // @codingStandardsIgnoreStart + $channel->basic_qos(0, $this->prefetchCount, false); $channel->basic_consume($this->queueName, '', false, false, false, false, $callbackConverter); // @codingStandardsIgnoreEnd while (count($channel->callbacks)) { diff --git a/lib/internal/Magento/Framework/Amqp/Test/Unit/QueueTest.php b/lib/internal/Magento/Framework/Amqp/Test/Unit/QueueTest.php new file mode 100644 index 0000000000000..b4e0b6c1fa53c --- /dev/null +++ b/lib/internal/Magento/Framework/Amqp/Test/Unit/QueueTest.php @@ -0,0 +1,74 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Framework\Amqp\Test\Unit; + +use Magento\Framework\Amqp\Config; +use Magento\Framework\Amqp\Queue; +use Magento\Framework\MessageQueue\EnvelopeFactory; +use PhpAmqpLib\Channel\AMQPChannel; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Psr\Log\LoggerInterface; + +class QueueTest extends TestCase +{ + private const PREFETCH_COUNT = 100; + /** + * @var Config|MockObject + */ + private $config; + + /** + * @var EnvelopeFactory|MockObject + */ + private $envelopeFactory; + + /** + * @var LoggerInterface|MockObject + */ + private $logger; + + /** + * @var Queue + */ + private $model; + + protected function setUp(): void + { + $this->config = $this->createMock(Config::class); + $this->envelopeFactory = $this->createMock(EnvelopeFactory::class); + $this->logger = $this->createMock(LoggerInterface::class); + + $this->model = new Queue( + $this->config, + $this->envelopeFactory, + 'testQueue', + $this->logger, + self::PREFETCH_COUNT + ); + } + + /** + * Test verifies that prefetch value is used to specify how many messages + * are being sent to the consumer at the same time. + */ + public function testSubscribe() + { + $callback = function () { + }; + $amqpChannel = $this->createMock(AMQPChannel::class); + $amqpChannel->expects($this->once()) + ->method('basic_qos') + ->with(0, self::PREFETCH_COUNT, false); + $this->config->expects($this->once()) + ->method('getChannel') + ->willReturn($amqpChannel); + + $this->model->subscribe($callback); + } +} diff --git a/lib/internal/Magento/Framework/Api/AbstractSimpleObjectBuilder.php b/lib/internal/Magento/Framework/Api/AbstractSimpleObjectBuilder.php index 35f115634ccda..fb0533bdf9c49 100644 --- a/lib/internal/Magento/Framework/Api/AbstractSimpleObjectBuilder.php +++ b/lib/internal/Magento/Framework/Api/AbstractSimpleObjectBuilder.php @@ -68,7 +68,7 @@ protected function _set($key, $value) protected function _getDataObjectType() { $dataObjectType = ''; - $pattern = '/(?<data_object>.*?)Builder(\\Interceptor)?/'; + $pattern = '/(?<data_object>.*?)Builder(\\\\Interceptor)?/'; if (preg_match($pattern, get_class($this), $match)) { $dataObjectType = $match['data_object']; } diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/AbstractSimpleObjectBuilderTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/AbstractSimpleObjectBuilderTest.php new file mode 100644 index 0000000000000..2393c2577f42b --- /dev/null +++ b/lib/internal/Magento/Framework/Api/Test/Unit/AbstractSimpleObjectBuilderTest.php @@ -0,0 +1,42 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Framework\Api\Test\Unit; + +use Magento\Framework\Api\ObjectFactory; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class AbstractSimpleObjectBuilderTest extends TestCase +{ + /** + * @var MockObject|ObjectFactory + */ + private $objectFactoryMock; + + /** + * @var StubAbstractSimpleObjectBuilder + */ + private $stubSimpleObjectBuilder; + + protected function setUp(): void + { + $this->objectFactoryMock = $this->createMock(ObjectFactory::class); + $this->stubSimpleObjectBuilder = new StubAbstractSimpleObjectBuilder($this->objectFactoryMock); + } + + public function testCreate() + { + $stubSimpleObjectMock = $this->createMock(StubAbstractSimpleObject::class); + $this->objectFactoryMock->expects($this->once()) + ->method('create') + ->with(StubAbstractSimpleObject::class, ['data' => []]) + ->willReturn($stubSimpleObjectMock); + $object = $this->stubSimpleObjectBuilder->create(); + $this->assertInstanceOf(StubAbstractSimpleObject::class, $object); + } +} diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/StubAbstractSimpleObjectBuilder.php b/lib/internal/Magento/Framework/Api/Test/Unit/StubAbstractSimpleObjectBuilder.php new file mode 100644 index 0000000000000..a8f1984750bc3 --- /dev/null +++ b/lib/internal/Magento/Framework/Api/Test/Unit/StubAbstractSimpleObjectBuilder.php @@ -0,0 +1,14 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Framework\Api\Test\Unit; + +use Magento\Framework\Api\AbstractSimpleObjectBuilder; + +class StubAbstractSimpleObjectBuilder extends AbstractSimpleObjectBuilder +{ +} diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/StubAbstractSimpleObjectBuilder/Interceptor.php b/lib/internal/Magento/Framework/Api/Test/Unit/StubAbstractSimpleObjectBuilder/Interceptor.php new file mode 100644 index 0000000000000..974a0cfc83da2 --- /dev/null +++ b/lib/internal/Magento/Framework/Api/Test/Unit/StubAbstractSimpleObjectBuilder/Interceptor.php @@ -0,0 +1,12 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Framework\Api\Test\Unit\StubAbstractSimpleObjectBuilder; + +class Interceptor extends \Magento\Framework\Api\Test\Unit\StubAbstractSimpleObjectBuilder +{ +} diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/StubAbstractSimpleObjectBuilder/InterceptorTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/StubAbstractSimpleObjectBuilder/InterceptorTest.php new file mode 100644 index 0000000000000..21c9df40f437c --- /dev/null +++ b/lib/internal/Magento/Framework/Api/Test/Unit/StubAbstractSimpleObjectBuilder/InterceptorTest.php @@ -0,0 +1,44 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Framework\Api\Test\Unit\StubAbstractSimpleObjectBuilder; + +use Magento\Framework\Api\ObjectFactory; +use Magento\Framework\Api\Test\Unit\StubAbstractSimpleObject; +use Magento\Framework\Api\Test\Unit\StubAbstractSimpleObjectBuilder; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; + +class InterceptorTest extends TestCase +{ + /** + * @var MockObject|ObjectFactory + */ + private $objectFactoryMock; + + /** + * @var StubAbstractSimpleObjectBuilder + */ + private $stubSimpleObjectBuilderInterceptor; + + protected function setUp(): void + { + $this->objectFactoryMock = $this->createMock(ObjectFactory::class); + $this->stubSimpleObjectBuilderInterceptor = new Interceptor($this->objectFactoryMock); + } + + public function testCreate() + { + $stubSimpleObjectMock = $this->createMock(StubAbstractSimpleObject::class); + $this->objectFactoryMock->expects($this->once()) + ->method('create') + ->with(StubAbstractSimpleObject::class, ['data' => []]) + ->willReturn($stubSimpleObjectMock); + $object = $this->stubSimpleObjectBuilderInterceptor->create(); + $this->assertInstanceOf(StubAbstractSimpleObject::class, $object); + } +} diff --git a/lib/internal/Magento/Framework/DB/FieldDataConverter.php b/lib/internal/Magento/Framework/DB/FieldDataConverter.php index c25e7aff1762e..f60624880c919 100644 --- a/lib/internal/Magento/Framework/DB/FieldDataConverter.php +++ b/lib/internal/Magento/Framework/DB/FieldDataConverter.php @@ -5,9 +5,11 @@ */ namespace Magento\Framework\DB; +use Magento\Framework\App\ObjectManager; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\DataConverter\DataConversionException; use Magento\Framework\DB\DataConverter\DataConverterInterface; +use Magento\Framework\DB\Query\BatchRangeIteratorFactory; use Magento\Framework\DB\Query\Generator; use Magento\Framework\DB\Select\QueryModifierInterface; @@ -46,6 +48,11 @@ class FieldDataConverter */ private $envBatchSize; + /** + * @var BatchRangeIteratorFactory + */ + private $batchIteratorFactory; + /** * Constructor * @@ -53,17 +60,21 @@ class FieldDataConverter * @param DataConverterInterface $dataConverter * @param SelectFactory $selectFactory * @param string|null $envBatchSize + * @param BatchRangeIteratorFactory|null $batchIteratorFactory */ public function __construct( Generator $queryGenerator, DataConverterInterface $dataConverter, SelectFactory $selectFactory, - $envBatchSize = null + $envBatchSize = null, + ?BatchRangeIteratorFactory $batchIteratorFactory = null ) { $this->queryGenerator = $queryGenerator; $this->dataConverter = $dataConverter; $this->selectFactory = $selectFactory; $this->envBatchSize = $envBatchSize; + $this->batchIteratorFactory = $batchIteratorFactory + ?? ObjectManager::getInstance()->get(BatchRangeIteratorFactory::class); } /** @@ -84,6 +95,31 @@ public function convert( $field, QueryModifierInterface $queryModifier = null ) { + $identifiers = explode(',', $identifier); + if (count($identifiers) > 1) { + $this->processTableWithCompositeIdentifier($connection, $table, $identifiers, $field, $queryModifier); + } else { + $this->processTableWithUniqueIdentifier($connection, $table, $identifier, $field, $queryModifier); + } + } + + /** + * Convert table (with unique identifier) field data from one representation to another + * + * @param AdapterInterface $connection + * @param string $table + * @param string $identifier + * @param string $field + * @param QueryModifierInterface|null $queryModifier + * @return void + */ + private function processTableWithUniqueIdentifier( + AdapterInterface $connection, + $table, + $identifier, + $field, + QueryModifierInterface $queryModifier = null + ): void { $select = $this->selectFactory->create($connection) ->from($table, [$identifier, $field]) ->where($field . ' IS NOT NULL'); @@ -122,6 +158,82 @@ public function convert( } } + /** + * Convert table (with composite identifier) field data from one representation to another + * + * @param AdapterInterface $connection + * @param string $table + * @param array $identifiers + * @param string $field + * @param QueryModifierInterface|null $queryModifier + * @return void + */ + private function processTableWithCompositeIdentifier( + AdapterInterface $connection, + $table, + $identifiers, + $field, + QueryModifierInterface $queryModifier = null + ): void { + $columns = $identifiers; + $columns[] = $field; + $select = $this->selectFactory->create($connection) + ->from($table, $columns) + ->where($field . ' IS NOT NULL'); + if ($queryModifier) { + $queryModifier->modify($select); + } + $iterator = $this->batchIteratorFactory->create( + [ + 'batchSize' => $this->getBatchSize(), + 'select' => $select, + 'correlationName' => $table, + 'rangeField' => $identifiers, + 'rangeFieldAlias' => '', + ] + ); + foreach ($iterator as $selectByRange) { + $rows = []; + foreach ($connection->fetchAll($selectByRange) as $row) { + $value = $row[$field]; + unset($row[$field]); + $constraints = []; + foreach ($row as $col => $val) { + $constraints[] = $connection->prepareSqlCondition($col, $val); + } + $rows[implode(' AND ', $constraints)] = $value; + } + $uniqueFieldDataArray = array_unique($rows); + foreach ($uniqueFieldDataArray as $uniqueFieldData) { + $constraints = array_keys($rows, $uniqueFieldData); + try { + $convertedValue = $this->dataConverter->convert($uniqueFieldData); + if ($uniqueFieldData === $convertedValue) { + // Skip for data rows that have been already converted + continue; + } + $bind = [$field => $convertedValue]; + foreach ($constraints as $where) { + $connection->update($table, $bind, $where); + } + + } catch (DataConversionException $e) { + throw new \Magento\Framework\DB\FieldDataConversionException( + sprintf( + \Magento\Framework\DB\FieldDataConversionException::MESSAGE_PATTERN, + $field, + $table, + implode(', ', $identifiers), + '(' . implode(') OR (', $constraints) . ')', + get_class($this->dataConverter), + $e->getMessage() + ) + ); + } + } + } + } + /** * Get batch size from environment variable or default * diff --git a/lib/internal/Magento/Framework/File/Uploader.php b/lib/internal/Magento/Framework/File/Uploader.php index 5e0bf593fef49..067e2611b406c 100644 --- a/lib/internal/Magento/Framework/File/Uploader.php +++ b/lib/internal/Magento/Framework/File/Uploader.php @@ -803,7 +803,8 @@ public static function getNewFileName($destinationFile) $fileInfo = pathinfo($destinationFile); $index = 1; while ($fileExists($fileInfo['dirname'] . '/' . $fileInfo['basename'])) { - $fileInfo['basename'] = $fileInfo['filename'] . '_' . $index++ . '.' . $fileInfo['extension']; + $fileInfo['basename'] = $fileInfo['filename'] . '_' . ($index++); + $fileInfo['basename'] .= isset($fileInfo['extension']) ? '.' . $fileInfo['extension'] : ''; } return $fileInfo['basename']; diff --git a/pub/index.php b/pub/index.php index 9e91f3bfa5488..2cde8b91aa5a2 100644 --- a/pub/index.php +++ b/pub/index.php @@ -20,6 +20,7 @@ <p>{$e->getMessage()}</p> </div> HTML; + http_response_code(500); exit(1); } From 4c8908f2b4721cdc4be2fd10b93fb963f2a72979 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 3 Aug 2021 12:01:30 +0300 Subject: [PATCH 10/35] refactored StorefrontVerifyOrderHistoryCommentsTest --- ...ontOrderCommentWithHTMLTagsDisplayTest.xml | 64 +++++++++++++++++++ ...orefrontVerifyOrderHistoryCommentsTest.xml | 3 + 2 files changed, 67 insertions(+) create mode 100644 app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderCommentWithHTMLTagsDisplayTest.xml diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderCommentWithHTMLTagsDisplayTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderCommentWithHTMLTagsDisplayTest.xml new file mode 100644 index 0000000000000..2175b6c796e97 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontOrderCommentWithHTMLTagsDisplayTest.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="StorefrontVerifyOrderHistoryCommentsWithHTMLTagsTest"> + <annotations> + <features value="Sales"/> + <stories value="Storefront Customer Order History Comments"/> + <title value="Verify Customer Order History Comments On Storefront"/> + <description value="Verify that comment with HTML tag is displayed properly on the Order View Page on Storefront"/> + <testCaseId value="MC-42694"/> + <useCaseId value="MC-42531"/> + <severity value="MINOR"/> + <group value="Sales"/> + </annotations> + <before> + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="submitOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> + </before> + <after> + <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + </after> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + <actionGroup ref="AdminOpenOrderViewPageByOrderIdActionGroup" stepKey="openOrder"> + <argument name="orderId" value="$createCustomerCart.return$"/> + </actionGroup> + + <actionGroup ref="AdminSalesOrderCommentsActionGroup" stepKey="fillAndSaveOrderComments"> + <argument name="comment" value="{{SalesOrderComments.commentWithHyperlink}}" /> + </actionGroup> + + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefront"> + <argument name="Customer" value="$$createCustomer$$"/> + </actionGroup> + + <actionGroup ref="StorefrontClickViewOrderLinkOnMyOrdersPageActionGroup" stepKey="clickViewOrder"/> + + <dontSee userInput="{{anchorTagFragment.anchorTag}}" selector="{{StorefrontCustomerOrderViewSection.orderComment}}" stepKey="dontSeeExposedHtmlCode"/> + </test> +</tests> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifyOrderHistoryCommentsTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifyOrderHistoryCommentsTest.xml index 2f4042d4d9760..218dfeab89413 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifyOrderHistoryCommentsTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontVerifyOrderHistoryCommentsTest.xml @@ -18,6 +18,9 @@ <useCaseId value="MC-42531"/> <severity value="MINOR"/> <group value="Sales"/> + <skip> + <issueId value="DEPRECATED">Use StorefrontOrderCommentWithHTMLTagsDisplayTest instead</issueId> + </skip> </annotations> <before> <!-- Create customer --> From 89b1716e5f2d52e8286cb990f1ed1fff7bed0f0d Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Thu, 5 Aug 2021 10:55:26 +0300 Subject: [PATCH 11/35] refactored MoveLastOrderedSimpleProductOnOrderPageTest --- ...edProductOnCustomerEditPageActionGroup.xml | 20 +++++++ ...derButtonOnEditCustomerPageActionGroup.xml | 19 +++++++ ...rderedGridOnCreateOrderPageActionGroup.xml | 23 ++++++++ ...astOrderedSimpleProductOnOrderPageTest.xml | 57 +++++++++++-------- 4 files changed, 95 insertions(+), 24 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCheckLastOrderedProductOnCustomerEditPageActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickCreateOrderButtonOnEditCustomerPageActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSeeProductInItemsOrderedGridOnCreateOrderPageActionGroup.xml diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCheckLastOrderedProductOnCustomerEditPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCheckLastOrderedProductOnCustomerEditPageActionGroup.xml new file mode 100644 index 0000000000000..c199392908528 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminCheckLastOrderedProductOnCustomerEditPageActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminCheckLastOrderedProductOnCustomerEditPageActionGroup"> + <annotations> + <description>Checks the last ordered product on the Customer Edit page</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <click selector="{{AdminCustomerActivitiesLastOrderedSection.addProductToOrder(productName)}}" stepKey="addLastOrderedProductToOrder"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickCreateOrderButtonOnEditCustomerPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickCreateOrderButtonOnEditCustomerPageActionGroup.xml new file mode 100644 index 0000000000000..eb9967002ed93 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickCreateOrderButtonOnEditCustomerPageActionGroup.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickCreateOrderButtonOnEditCustomerPageActionGroup"> + <annotations> + <description>Clicks Create Order Button on the Edit Customer Page</description> + </annotations> + + <click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/> + <waitForPageLoad stepKey="waitForPageLoaded"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSeeProductInItemsOrderedGridOnCreateOrderPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSeeProductInItemsOrderedGridOnCreateOrderPageActionGroup.xml new file mode 100644 index 0000000000000..75b4a6c494646 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSeeProductInItemsOrderedGridOnCreateOrderPageActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminSeeProductInItemsOrderedGridOnCreateOrderPageActionGroup"> + <annotations> + <description>Sees Product in the "Items Ordered" Grid on th Create Order page</description> + </annotations> + <arguments> + <argument name="rowIndex" type="string" defaultValue="1"/> + <argument name="columnName" type="string" defaultValue="Product"/> + <argument name="expectedValue" type="string"/> + </arguments> + + <see selector="{{AdminCustomerCreateNewOrderSection.gridCell(rowIndex, columnName)}}" userInput="{{expectedValue}}" stepKey="seeProductAttribute"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedSimpleProductOnOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedSimpleProductOnOrderPageTest.xml index 71da699e533bc..dd2568c130a02 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedSimpleProductOnOrderPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/MoveLastOrderedSimpleProductOnOrderPageTest.xml @@ -20,45 +20,54 @@ <group value="mtf_migrated"/> </annotations> <before> - <!-- Login as admin --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - <!-- Create customer --> <createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> - - <!-- Create product --> <createData entity="SimpleProduct2" stepKey="createProduct"/> + + <createData entity="CustomerCart" stepKey="createCustomerCart"> + <requiredEntity createDataKey="createCustomer"/> + </createData> + <createData entity="CustomerCartItem" stepKey="addCartItem"> + <requiredEntity createDataKey="createCustomerCart"/> + <requiredEntity createDataKey="createProduct"/> + </createData> + <createData entity="CustomerAddressInformation" stepKey="addCustomerOrderAddress"> + <requiredEntity createDataKey="createCustomerCart"/> + </createData> + <updateData createDataKey="createCustomerCart" entity="CustomerOrderPaymentMethod" stepKey="submitOrder"> + <requiredEntity createDataKey="createCustomerCart"/> + </updateData> </before> <after> - <!-- Delete created data --> <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> </after> - <!-- Create order --> - <actionGroup ref="CreateOrderActionGroup" stepKey="createOrder"> - <argument name="product" value="$$createProduct$$"/> - <argument name="customer" value="$$createCustomer$$"/> - </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="createOrder"/> - <!-- Search and open customer --> - <actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterCreatedCustomer"> - <argument name="email" value="$$createCustomer.email$$"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterCreatedCustomer"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickEditButton"/> + <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage"> + <argument name="customerId" value="$createCustomer.id$"/> </actionGroup> - <actionGroup ref="AdminClickFirstRowEditLinkOnCustomerGridActionGroup" stepKey="clickEditButton"/> - <!-- Click create order --> - <click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/> - - <!-- Select product in Last Ordered Items section --> - <click selector="{{AdminCustomerActivitiesLastOrderedSection.addProductToOrder($$createProduct.name$$)}}" stepKey="addProductToOrder"/> - - <!-- Click Update Changes --> + <actionGroup ref="AdminClickCreateOrderButtonOnEditCustomerPageActionGroup" stepKey="clickCreateOrder"/> + + <actionGroup ref="AdminCheckLastOrderedProductOnCustomerEditPageActionGroup" stepKey="addProductToOrder"> + <argument name="productName" value="$$createProduct.name$$"/> + </actionGroup> + <click selector="{{AdminCustomerCreateNewOrderSection.updateChangesBtn}}" stepKey="clickUpdateChangesBtn"/> - <!-- Assert product in items ordered grid --> - <see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createProduct.name$$" stepKey="seeProductName"/> - <see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$$createProduct.price$$" stepKey="seeProductPrice"/> + <actionGroup ref="AdminSeeProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductName"> + <argument name="expectedValue" value="$$createProduct.name$$"/> + </actionGroup> + <actionGroup ref="AdminSeeProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductPrice"> + <argument name="columnName" value="Price"/> + <argument name="expectedValue" value="$$createProduct.price$$"/> + </actionGroup> + </test> </tests> From 9ddbde23b171ac7ada6f7347e109485b2f401d64 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Fri, 6 Aug 2021 17:55:05 +0300 Subject: [PATCH 12/35] updated with AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup --- .../Mftf/Test/AdminAddDefaultImageBundleProductTest.xml | 4 ++-- .../Test/Mftf/Test/AdminDeleteABundleProductTest.xml | 4 ++-- .../Test/AdminFilterProductListByBundleProductTest.xml | 4 ++-- .../Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml | 8 ++++---- .../Test/Mftf/Test/AdminProductBundleCreationTest.xml | 4 ++-- .../Test/AdminRemoveDefaultImageBundleProductTest.xml | 4 ++-- .../Test/Mftf/Test/BundleProductFixedPricingTest.xml | 4 ++-- .../Mftf/Test/EnableDisableBundleProductStatusTest.xml | 4 ++-- .../Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml | 2 +- .../Mftf/Test/MassEnableDisableBundleProductsTest.xml | 8 ++++---- .../Mftf/Test/NewProductsListWidgetBundleProductTest.xml | 4 ++-- .../Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml | 4 ++-- .../Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml | 4 ++-- ...refrontBundleProductShownInCategoryListAndGridTest.xml | 4 ++-- .../Test/Mftf/Test/StorefrontEditBundleProductTest.xml | 4 ++-- .../StorefrontGoToDetailsPageWhenAddingToCartTest.xml | 4 ++-- 16 files changed, 35 insertions(+), 35 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml index 538cf391ea352..d38011d6e42d0 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml @@ -52,11 +52,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml index 83db83949f059..ed4b97e6cb31d 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml @@ -42,11 +42,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml index 7ef529f0e6976..1ec071f81581a 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml @@ -42,11 +42,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml index 3b0f9afd3d4f6..e5a8b73838f9c 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml @@ -50,11 +50,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> @@ -83,11 +83,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptionsx2"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRowx2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRowx2"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions22"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow22"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow22"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts2"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty12"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty22"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml index 1b3de481b2a08..ccbaeabacff2c 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml @@ -49,11 +49,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml index 17c31b8a5ae53..a57821ee92537 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml @@ -56,11 +56,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml index d9ab2962964b2..82407464b0ad2 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml @@ -51,11 +51,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml index 45328900bf156..61aa2b6df5d77 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml @@ -48,11 +48,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 7e5db7643c2dd..b4ea354befa16 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -27,7 +27,7 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions" after="waitForPageLoadAfterBundleProducts"> <argument name="product" value="SimpleProduct"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow" after="filterBundleProductOptions"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow" after="filterBundleProductOptions"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts" after="selectFirstGridRow"/> <fillField selector="{{AdminProductFormBundleSection.firstProductQuantity}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty" after="clickAddSelectedBundleProducts"/> <actionGroup ref="SaveProductFormActionGroup" stepKey="saveBundleProduct" after="fillProductDefaultQty"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml index b472eb57b7a8e..03228e6f6f52f 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml @@ -50,11 +50,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> @@ -80,11 +80,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptionsx2"> <argument name="product" value="$$simpleProduct3$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRowx2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRowx2"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions22"> <argument name="product" value="$$simpleProduct4$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow22"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow22"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts2"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty12"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty22"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml index 12d4f00982cda..7622dd92469f8 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml @@ -60,11 +60,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="1" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="1" stepKey="fillProductDefaultQty2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml index bd61f7aaf3b99..9e5fd28c71903 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml @@ -51,11 +51,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml index 63362071568b5..282b1dcfe4c23 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml @@ -56,11 +56,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml index 04753baec45f6..fb56660c7bfc0 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml @@ -61,11 +61,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml index f30cdc21513da..2576404a223c2 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml @@ -51,11 +51,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml index 2b74e6fc99390..e6804bb2e936f 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml @@ -55,11 +55,11 @@ <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> <argument name="product" value="$$simpleProduct1$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> <argument name="product" value="$$simpleProduct2$$"/> </actionGroup> - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> From 58e41eaa2b40f9de7228e8c1629570da62b737a3 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Fri, 6 Aug 2021 18:01:49 +0300 Subject: [PATCH 13/35] Updated with AdminOpenCreateBundleProductPageActionGroup --- .../Mftf/Test/AdminBasicBundleProductAttributesTest.xml | 6 +++--- .../Test/Mftf/Test/AdminDeleteABundleProductTest.xml | 4 ++-- .../Test/AdminFilterProductListByBundleProductTest.xml | 4 ++-- .../Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml | 8 ++++---- .../Test/Mftf/Test/AdminProductBundleCreationTest.xml | 6 +++--- .../Test/Mftf/Test/BundleProductFixedPricingTest.xml | 6 +++--- .../Mftf/Test/BundleProductWithTierPriceInCartTest.xml | 4 ++-- ...tWithTierPriceWithFixedAndPercentOptionsInCartTest.xml | 4 ++-- .../Mftf/Test/CurrencyChangingBundleProductInCartTest.xml | 4 ++-- .../Mftf/Test/EnableDisableBundleProductStatusTest.xml | 4 ++-- .../Mftf/Test/MassEnableDisableBundleProductsTest.xml | 8 ++++---- .../Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml | 4 ++-- ...refrontBundleProductShownInCategoryListAndGridTest.xml | 6 +++--- .../StorefrontGoToDetailsPageWhenAddingToCartTest.xml | 4 ++-- 14 files changed, 36 insertions(+), 36 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml index 228c1d3cf1def..1becdcb1fa839 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminBasicBundleProductAttributesTest.xml @@ -29,9 +29,9 @@ </actionGroup> <!--Go to product creation page--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/> - <waitForPageLoad stepKey="waitForBundleProductCreationPage"/> - + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreationPage"/> + <!--Enable/Disable Toggle--> <checkOption selector="{{AdminProductFormBundleSection.enableDisableToggle}}" stepKey="clickOnEnableDisableToggle"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml index 83db83949f059..62359997907e2 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml @@ -31,8 +31,8 @@ </after> <!--Create bundle product--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/> - <waitForPageLoad stepKey="waitForBundleProductCreationPage"/> + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreationPage"/> <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/> <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml index 7ef529f0e6976..5e0fd05eaec4a 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml @@ -31,8 +31,8 @@ </after> <!--Create bundle product--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/> - <waitForPageLoad stepKey="waitForBundleProductCreationPage"/> + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreationPage"/> <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/> <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml index 3b0f9afd3d4f6..fd120c16f4827 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml @@ -37,8 +37,8 @@ </after> <!--Go to bundle product creation page--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" /> - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/> <!--Create bundle product--> <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> @@ -70,8 +70,8 @@ <!--Creating Second bundle product--> <!--Go to bundle product creation page--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage2" /> - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad2"/> + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage2"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreationPage2"/> <!--Create bundle product 2--> <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml index 1b3de481b2a08..5200a821ebe3d 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml @@ -36,9 +36,9 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <!-- go to bundle product creation page--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" /> - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> - + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/> + <!-- Add two bundle items --> <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml index d9ab2962964b2..f27c98455d951 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml @@ -38,9 +38,9 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <!--Go to bundle product creation page--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" /> - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> - + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/> + <!-- Add two bundle items --> <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml index def24c86e1730..25c714ae14f95 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceInCartTest.xml @@ -36,8 +36,8 @@ </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/> - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/> <actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainFieldsForBundle"/> <actionGroup ref="AddBundleOptionWithOneProductActionGroup" stepKey="addBundleOption1"> <argument name="x" value="0"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceWithFixedAndPercentOptionsInCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceWithFixedAndPercentOptionsInCartTest.xml index 59a6869747444..48639b68849ae 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceWithFixedAndPercentOptionsInCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductWithTierPriceWithFixedAndPercentOptionsInCartTest.xml @@ -41,8 +41,8 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> </after> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/> - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/> <click selector="{{AdminProductFormBundleSection.dynamicSkuToggle}}" stepKey="disableDynamicSku"/> <click selector="{{AdminProductFormBundleSection.dynamicPrice}}" stepKey="clickDynamicPriceSwitcher"/> <fillField selector="{{AdminProductFormBundleSection.priceField}}" userInput="100" stepKey="fillBundlePrice"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml index b25139835de59..fd295a7e47b3c 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/CurrencyChangingBundleProductInCartTest.xml @@ -45,8 +45,8 @@ <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> </after> <!--Go to bundle product creation page--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage"/> - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/> <actionGroup ref="FillMainBundleProductFormActionGroup" stepKey="fillMainFieldsForBundle"/> <!-- Add Option, a "Radio Buttons" type option --> <actionGroup ref="AddBundleOptionWithTwoProductsActionGroup" stepKey="addBundleOptionWithTwoProducts2"> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml index 45328900bf156..0ace3c641df67 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml @@ -35,8 +35,8 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <!--Go to bundle product creation page--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" /> - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/> <!-- Add two bundle items --> <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml index b472eb57b7a8e..52d1c8ace4731 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml @@ -37,8 +37,8 @@ </after> <!--Go to bundle product creation page--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" /> - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/> <!--Create bundle product--> <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> @@ -67,8 +67,8 @@ <!--Creating Second bundle product--> <!--Go to bundle product creation page--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage2" /> - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad2"/> + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage2"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad2"/> <!--Create bundle product 2--> <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml index 63362071568b5..0752226ea519b 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml @@ -37,8 +37,8 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <!-- go to bundle product creation page--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" /> - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/> <!--Add description--> <click selector="{{AdminProductFormBundleSection.contentDropDown}}" stepKey="openDescriptionDropDown"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml index 04753baec45f6..1f0880ecbdf13 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml @@ -42,9 +42,9 @@ </actionGroup> <!--Go to bundle product creation page--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" /> - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> - + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/> + <!--Categories--> <click selector="{{AdminProductFormBundleSection.categoriesDropDown}}" stepKey="dropDownCategories"/> <fillField selector="{{AdminProductFormBundleSection.searchForCategory}}" userInput="{{SimpleSubCategory.name}}" stepKey="searchForCategory"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml index 2b74e6fc99390..5fb7e31025c2e 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml @@ -36,8 +36,8 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> </after> <!--Go to bundle product creation page--> - <amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" /> - <waitForPageLoad stepKey="waitForBundleProductCreatePageToLoad"/> + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/> <!--Categories--> <click selector="{{AdminProductFormBundleSection.categoriesDropDown}}" stepKey="dropDownCategories"/> From b41e3c58b8d930afd81358a33c63fc9b357f80f3 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Fri, 6 Aug 2021 18:11:11 +0300 Subject: [PATCH 14/35] updated with AdminFillBundleItemQtyActionGroup --- .../AdminAddDefaultImageBundleProductTest.xml | 14 ++++++++-- .../Test/AdminDeleteABundleProductTest.xml | 13 ++++++++-- ...inFilterProductListByBundleProductTest.xml | 13 ++++++++-- .../AdminMassDeleteBundleProductsTest.xml | 26 ++++++++++++++++--- .../Test/AdminProductBundleCreationTest.xml | 13 ++++++++-- ...minRemoveDefaultImageBundleProductTest.xml | 13 ++++++++-- .../Test/BundleProductFixedPricingTest.xml | 13 ++++++++-- .../EnableDisableBundleProductStatusTest.xml | 13 ++++++++-- .../MassEnableDisableBundleProductsTest.xml | 26 ++++++++++++++++--- ...NewProductsListWidgetBundleProductTest.xml | 14 ++++++++-- .../Mftf/Test/StorefrontAdminEditDataTest.xml | 13 ++++++++-- .../StorefrontBundleProductDetailsTest.xml | 13 ++++++++-- ...eProductShownInCategoryListAndGridTest.xml | 15 +++++++++-- .../Test/StorefrontEditBundleProductTest.xml | 13 ++++++++-- ...ontGoToDetailsPageWhenAddingToCartTest.xml | 14 ++++++++-- 15 files changed, 192 insertions(+), 34 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml index 538cf391ea352..a4073ac938c51 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultImageBundleProductTest.xml @@ -58,8 +58,18 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <!-- Add image to product --> <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml index 83db83949f059..51d4c1ced9a42 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminDeleteABundleProductTest.xml @@ -48,8 +48,17 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <!--Fill out ancillary data on bundle product--> <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml index 7ef529f0e6976..35f4aeeb386f4 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminFilterProductListByBundleProductTest.xml @@ -48,8 +48,17 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <!--Fill out ancillary data on bundle product--> <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml index 3b0f9afd3d4f6..78ee8e4e81aeb 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml @@ -56,8 +56,17 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <!--Fill out ancillary data on bundle product--> <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> @@ -89,8 +98,17 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow22"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts2"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty12"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty22"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty12"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty22"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name2}}" stepKey="fillProductName2"/> <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku2}}" stepKey="fillProductSku2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml index 1b3de481b2a08..4d5f4960f2978 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml @@ -55,8 +55,17 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <!--Create a bundle product with ancillary data--> <actionGroup ref="CreateBasicBundleProductActionGroup" stepKey="createBundledProduct"> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml index 17c31b8a5ae53..b1df1a002eccd 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultImageBundleProductTest.xml @@ -62,8 +62,17 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <!-- Add image to product --> <actionGroup ref="AddProductImageActionGroup" stepKey="addImageForProduct"> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml index d9ab2962964b2..0fd6bfbd27891 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/BundleProductFixedPricingTest.xml @@ -57,8 +57,17 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <!--Fill out ancillary data on bundle product--> <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml index 45328900bf156..6e7b9cb62e7cd 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml @@ -54,8 +54,17 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <!--Fill out ancillary data on bundle product--> <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml index b472eb57b7a8e..433d030760e7c 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml @@ -56,8 +56,17 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> @@ -86,8 +95,17 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow22"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts2"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty12"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty22"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="illProductDefaultQty12"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty22"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <fillField selector="{{AdminProductFormBundleSection.productName}}" userInput="{{BundleProduct.name2}}" stepKey="fillProductName2"/> <fillField selector="{{AdminProductFormBundleSection.productSku}}" userInput="{{BundleProduct.sku2}}" stepKey="fillProductSku2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml index 12d4f00982cda..f20ac15a07f6f 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/NewProductsListWidgetBundleProductTest.xml @@ -66,8 +66,18 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="1" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="1" stepKey="fillProductDefaultQty2"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveProduct"/> <!-- If PageCache is enabled, Cache clearing happens here, via merge --> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml index bd61f7aaf3b99..cb9cf697219af 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontAdminEditDataTest.xml @@ -57,8 +57,17 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <click stepKey="saveProductBundle" selector="{{AdminProductFormActionSection.saveButton}}"/> <see stepKey="assertSuccess" selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml index 63362071568b5..b0587cf8f59ff 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml @@ -62,8 +62,17 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <!--Create a basic bundle product--> <actionGroup ref="CreateBasicBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml index 04753baec45f6..51921fd8f8fa2 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductShownInCategoryListAndGridTest.xml @@ -67,8 +67,19 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> <!--Save the product--> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml index f30cdc21513da..d5041eb0d1432 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.xml @@ -57,8 +57,17 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> <click stepKey="saveProductBundle" selector="{{AdminProductFormActionSection.saveButton}}"/> <see stepKey="assertSuccess" selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml index 2b74e6fc99390..30c248c5dde8b 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml @@ -61,8 +61,18 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="0"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> + <argument name="optionIndex" value="0"/> + <argument name="productIndex" value="1"/> + <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> + </actionGroup> + <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"/> <!--Save the product--> From ed8d5f49c71e025683035a05bbfb0bb937ec3113 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Mon, 9 Aug 2021 13:12:56 +0300 Subject: [PATCH 15/35] ref --- .../Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml index 433d030760e7c..02e62e7919eda 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/MassEnableDisableBundleProductsTest.xml @@ -95,7 +95,7 @@ </actionGroup> <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow22"/> <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts2"/> - <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="illProductDefaultQty12"> + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty12"> <argument name="optionIndex" value="0"/> <argument name="productIndex" value="0"/> <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> From 778c8ae0fb9d1bd71c62db75528c9e42bcb54504 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Fri, 13 Aug 2021 16:16:14 +0300 Subject: [PATCH 16/35] refactored ZeroSubtotalOrdersWithProcessingStatusTest --- ...oSubtotalOrderIsInProcessingStatusTest.xml | 73 +++++++++++++++++++ ...SubtotalOrdersWithProcessingStatusTest.xml | 3 + 2 files changed, 76 insertions(+) create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckZeroSubtotalOrderIsInProcessingStatusTest.xml diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckZeroSubtotalOrderIsInProcessingStatusTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckZeroSubtotalOrderIsInProcessingStatusTest.xml new file mode 100644 index 0000000000000..026573c558280 --- /dev/null +++ b/app/code/Magento/Checkout/Test/Mftf/Test/AdminCheckZeroSubtotalOrderIsInProcessingStatusTest.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCheckZeroSubtotalOrderIsInProcessingStatusTest"> + <annotations> + <features value="Checkout"/> + <stories value="MAGETWO-71375: Zero Subtotal Orders have incorrect status"/> + <title value="Zero Subtotal Orders should have the 'Processing' status on creating"/> + <description value="Created order should be in Processing status"/> + <severity value="MAJOR"/> + <testCaseId value="MAGETWO-94178"/> + <group value="checkout"/> + </annotations> + <before> + <createData entity="SimpleSubCategory" stepKey="simplecategory"/> + <createData entity="SimpleProduct" stepKey="simpleproduct"> + <requiredEntity createDataKey="simplecategory"/> + </createData> + <createData entity="PaymentMethodsSettingConfig" stepKey="paymentMethodsSettingConfig"/> + <createData entity="FreeShippingMethodsSettingConfig" stepKey="freeShippingMethodsSettingConfig"/> + + <createData entity="ApiSalesRule" stepKey="createCartPriceRule"> + <field key="discount_amount">100</field> + </createData> + <createData entity="ApiSalesRuleCoupon" stepKey="createCartPriceRuleCoupon"> + <requiredEntity createDataKey="createCartPriceRule"/> + </createData> + + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + + </before> + + <after> + <deleteData createDataKey="createCartPriceRule" stepKey="deleteSalesRule"/> + <createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/> + <createData entity="DisableFreeShippingConfig" stepKey="disableFreeShippingConfig"/> + <createData entity="DisablePaymentMethodsSettingConfig" stepKey="disablePaymentMethodsSettingConfig"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + <deleteData createDataKey="simpleproduct" stepKey="deleteProduct"/> + <deleteData createDataKey="simplecategory" stepKey="deleteCategory"/> + </after> + + <actionGroup ref="AddSimpleProductToCartActionGroup" stepKey="AddProductToCard"> + <argument name="product" value="$$simpleproduct$$"/> + </actionGroup> + + <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="clickToProceedToCheckout"/> + + <actionGroup ref="ShipmentFormFreeShippingActionGroup" stepKey="shipmentFormFreeShippingActionGroup"/> + + <actionGroup ref="StorefrontApplyDiscountCodeActionGroup" stepKey="applyDiscountCoupon"> + <argument name="discountCode" value="$createCartPriceRuleCoupon.code$"/> + </actionGroup> + + <actionGroup ref="ClickPlaceOrderActionGroup" stepKey="clickPlaceOrder"/> + <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> + + <actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToSalesOrderPage"/> + + <actionGroup ref="AdminCheckOrderStatusInGridActionGroup" stepKey="seeOrderStatusInGrid"> + <argument name="orderId" value="$grabOrderNumber"/> + <argument name="status" value="Processing"/> + </actionGroup> + + </test> +</tests> diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml index d4e473466c943..66f8e327b9d22 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml @@ -17,6 +17,9 @@ <severity value="MAJOR"/> <testCaseId value="MAGETWO-94178"/> <group value="checkout"/> + <skip> + <issueId value="DEPRECATED">Use AdminCheckZeroSubtotalOrderIsInProcessingStatusTest instead</issueId> + </skip> </annotations> <before> <createData entity="SimpleSubCategory" stepKey="simplecategory"/> From df6785148181fe5d86e16833cc07e44328227eaf Mon Sep 17 00:00:00 2001 From: Indrani sonawane <indranisonawane@BLR1-LMC-N71241.local> Date: Tue, 31 Aug 2021 12:39:26 +0530 Subject: [PATCH 17/35] 33326-Resolved the merged conflict --- .../AdminDeleteConfigurableChildProductsTest.xml | 12 +----------- .../StorefrontProductNameWithHTMLEntitiesTest.xml | 7 +------ ...StorefrontConfigurableProductCanAddToCartTest.xml | 11 +---------- ...torefrontConfigurableProductCantAddToCartTest.xml | 6 +----- 4 files changed, 4 insertions(+), 32 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml index 83ddb7c55d6b7..31d496f2f8452 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml @@ -53,7 +53,7 @@ <requiredEntity createDataKey="createConfigProductAttribute"/> <requiredEntity createDataKey="getConfigAttributeOption1"/> </createData> - <!--Create a simple product and give it the attribute with the second option --> + <!--Create a simple product and give it the attribute with the second option --> <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> <requiredEntity createDataKey="createConfigProductAttribute"/> <requiredEntity createDataKey="getConfigAttributeOption2"/> @@ -93,11 +93,6 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProductToLoad"/> <!--Verify Product is visible and In Stock --> - <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage"/> - <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductNameInStoreFront"> - <argument name="value" value="$$createConfigProduct.name$$"/> - </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigProduct.price$$" stepKey="seeProductPriceInStoreFront"/> <actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="seeCategoryInFrontPage"> <argument name="categoryName" value="$$createCategory.name$$"/> </actionGroup> @@ -134,11 +129,6 @@ <argument name="productName" value="$$createConfigProduct.name$$"/> </actionGroup> <!--Open Product Store Front Page and Verify Product is Out Of Stock --> - <amOnPage url="$$createConfigProduct.custom_attributes[url_key]$$.html" stepKey="openProductInStoreFront1"/> - <waitForPageLoad stepKey="waitForProductToLoad1"/> - <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage1"/> - <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductNameInStoreFront1"> - <argument name="value" value="$$createConfigProduct.name$$"/> <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductInStoreFront1"> <argument name="product" value="$createConfigProduct$"/> </actionGroup> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml index 07288121c1a72..5f2e8e9f734c1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml @@ -6,7 +6,7 @@ */ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontProductNameWithHTMLEntitiesTest"> <annotations> <features value="Catalog"/> @@ -48,11 +48,6 @@ </actionGroup> <!--Open product display page--> - <click selector="{{StorefrontCategoryProductSection.ProductTitleByName(productWithHTMLEntityOne.name)}}" stepKey="clickProductToGoProductPage"/> - <waitForPageLoad stepKey="waitForProductDisplayPageLoad2"/> - - <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeCorrectName"> - <argument name="value" value="{{productWithHTMLEntityOne.name}}"/> <actionGroup ref="StorefrontOpenProductFromCategoryPageActionGroup" stepKey="clickProductToGoProductPage"> <argument name="productName" value="{{productWithHTMLEntityOne.name}}"/> </actionGroup> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml index e09e8c2294f96..460e15ecce766 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml @@ -6,7 +6,7 @@ */ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontConfigurableProductCanAddToCartTest"> <annotations> <features value="ConfigurableProduct"/> @@ -47,14 +47,6 @@ </after> <!-- Verify adding configurable product to cart after an option is selected in storefront product view --> - - <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/> - <waitForPageLoad stepKey="wait"/> - <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName"> - <argument name="value" value="{{_defaultProduct.name}}"/> - </actionGroup> - <selectOption userInput="{{colorProductAttribute1.name}}" selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" stepKey="selectOption1"/> - <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="amOnConfigurableProductPage"> <argument name="productUrlKey" value="{{_defaultProduct.urlKey}}"/> </actionGroup> @@ -66,7 +58,6 @@ <argument name="attributeLabel" value="{{colorProductAttribute.default_label}}"/> <argument name="optionLabel" value="{{colorProductAttribute1.name}}"/> </actionGroup> - <waitForElementVisible selector="{{StorefrontProductInfoMainSection.AddToCart}}" stepKey="waitForAddToCartVisible"/> <actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> <argument name="product" value="_defaultProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml index 672fe14039254..6bb4e2a8b3b31 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml @@ -6,7 +6,7 @@ */ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontConfigurableProductCantAddToCartTest"> <annotations> <features value="ConfigurableProduct"/> @@ -47,10 +47,6 @@ </after> <!-- Verify not able to add configurable product to cart when no option is selected in storefront product view --> - <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="amOnConfigurableProductPage"/> - <waitForPageLoad stepKey="wait"/> - <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName"> - <argument name="value" value="{{_defaultProduct.name}}"/> <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="amOnConfigurableProductPage"> <argument name="productUrlKey" value="{{_defaultProduct.urlKey}}"/> </actionGroup> From 1e565e0a48522a825b194381f203b681447198b2 Mon Sep 17 00:00:00 2001 From: Indrani sonawane <indranisonawane@BLR1-LMC-N71241.local> Date: Tue, 31 Aug 2021 18:15:01 +0530 Subject: [PATCH 18/35] 33326-Replaced remaining see StorefrontProductInfoMainSection.productName with AssertStorefrontProductInfoMainProductNameActionGroup --- .../AdminCreateProductCustomAttributeSetTest.xml | 4 +++- .../AdminDeleteConfigurableChildProductsTest.xml | 2 +- ...StorefrontProductNameWithHTMLEntitiesTest.xml | 2 +- ...onfigurableProductsWithAssignedImagesTest.xml | 16 ++++++++++++---- .../Test/AdminConfigurableProductLongSkuTest.xml | 4 +++- ...efrontConfigurableProductCanAddToCartTest.xml | 2 +- ...frontConfigurableProductCantAddToCartTest.xml | 2 +- ...torefrontVisibilityOfDuplicateProductTest.xml | 4 +++- .../StorefrontCheckTaxAddingValidVATIdTest.xml | 4 +++- ...ateDownloadableProductWithManageStockTest.xml | 4 +++- ...portDownloadableProductsWithFileLinksTest.xml | 4 +++- ...mportDownloadableProductsWithUrlLinksTest.xml | 4 +++- .../Mftf/Test/AdminImportGroupedProductTest.xml | 4 +++- ...ontAddMultipleStoreProductsToWishlistTest.xml | 4 +++- 14 files changed, 43 insertions(+), 17 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml index 069baf6544d38..c8d6dc40da67a 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductCustomAttributeSetTest.xml @@ -82,7 +82,9 @@ <amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="goToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <seeInTitle userInput="{{_defaultProduct.name}}" stepKey="seeProductNameInTitlte"/> - <see userInput="{{_defaultProduct.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="assertProductName"> + <argument name="value" value="{{_defaultProduct.name}}"/> + </actionGroup> <see userInput="{{_defaultProduct.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> <see userInput="${{_defaultProduct.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertProductPrice"/> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml index 31d496f2f8452..5b1c3c7afc317 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteConfigurableChildProductsTest.xml @@ -53,7 +53,7 @@ <requiredEntity createDataKey="createConfigProductAttribute"/> <requiredEntity createDataKey="getConfigAttributeOption1"/> </createData> - <!--Create a simple product and give it the attribute with the second option --> + <!--Create a simple product and give it the attribute with the second option --> <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> <requiredEntity createDataKey="createConfigProductAttribute"/> <requiredEntity createDataKey="getConfigAttributeOption2"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml index 5f2e8e9f734c1..8bbe9b137abbb 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductNameWithDoubleQuoteTest/StorefrontProductNameWithHTMLEntitiesTest.xml @@ -6,7 +6,7 @@ */ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontProductNameWithHTMLEntitiesTest"> <annotations> <features value="Catalog"/> diff --git a/app/code/Magento/ConfigurableImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml b/app/code/Magento/ConfigurableImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml index 67a7a0970eb36..c8fc9e33ba543 100644 --- a/app/code/Magento/ConfigurableImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml +++ b/app/code/Magento/ConfigurableImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml @@ -276,7 +276,9 @@ <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> <argument name="productUrl" value="{{ImportProduct_Configurable.urlKey}}"/> </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName"> + <argument name="value" value="{{ImportProduct_Configurable.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku"/> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="As low as ${{ImportProductSimple1_Configurable.price}}" stepKey="seePrice"/> <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Configurable.baseImageName)}}" stepKey="seeBaseImage"/> @@ -286,7 +288,9 @@ <argument name="attributeLabel" value="{{ProductAttributeFrontendLabelImport1.label}}"/> <argument name="optionLabel" value="{{ProductAttributeOptionOneForExportImport.label}}"/> </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName2"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName2"> + <argument name="value" value="{{ImportProduct_Configurable.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku2"/> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProductSimple1_Configurable.price}}" stepKey="seePrice2"/> <waitForPageLoad stepKey="waitForImageLoad1"/> @@ -297,7 +301,9 @@ <argument name="attributeLabel" value="{{ProductAttributeFrontendLabelImport1.label}}"/> <argument name="optionLabel" value="{{ProductAttributeOptionTwoForExportImport.label}}"/> </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName3"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName3"> + <argument name="value" value="{{ImportProduct_Configurable.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku3"/> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProductSimple2_Configurable.price}}" stepKey="seePrice3"/> <waitForPageLoad stepKey="waitForImageLoad2"/> @@ -308,7 +314,9 @@ <argument name="attributeLabel" value="{{ProductAttributeFrontendLabelImport1.label}}"/> <argument name="optionLabel" value="{{ProductAttributeOptionThreeForImport.label}}"/> </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Configurable.name}}" stepKey="seeProductName4"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName4"> + <argument name="value" value="{{ImportProduct_Configurable.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Configurable.sku}}" stepKey="seeSku4"/> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProductSimple3_Configurable.price}}" stepKey="seePrice4"/> <waitForPageLoad stepKey="waitForImageLoad3"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml index 4915a17c738a4..46ce43a5369e6 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductLongSkuTest.xml @@ -105,7 +105,9 @@ <click selector="{{StorefrontCategoryProductSection.ProductTitleByName(ProductWithLongNameSku.name)}}" stepKey="clickOnProductName"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> <seeInTitle userInput="{{ProductWithLongNameSku.name}}" stepKey="assertProductNameTitle"/> - <see userInput="{{ProductWithLongNameSku.name}}" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="assertProductName"> + <argument name="value" value="{{ProductWithLongNameSku.name}}"/> + </actionGroup> <see userInput="{{ProductWithLongNameSku.sku}}" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku"/> <see selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" userInput="$$createConfigProductAttribute.default_frontend_label$$" stepKey="seeColorAttributeName1"/> <see selector="{{StorefrontProductInfoMainSection.productAttributeOptions1}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="seeInDropDown1"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml index 460e15ecce766..b3b02d4201695 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCanAddToCartTest.xml @@ -6,7 +6,7 @@ */ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontConfigurableProductCanAddToCartTest"> <annotations> <features value="ConfigurableProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml index 6bb4e2a8b3b31..752d31826021f 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductDetailsTest/StorefrontConfigurableProductCantAddToCartTest.xml @@ -6,7 +6,7 @@ */ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="StorefrontConfigurableProductCantAddToCartTest"> <annotations> <features value="ConfigurableProduct"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml index c4f23dfebf5e7..0bec95baf0dd0 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVisibilityOfDuplicateProductTest.xml @@ -205,7 +205,9 @@ <comment userInput="Assert product options in Storefront product page" stepKey="commentAssertProductOptions"/> <amOnPage url="{{StorefrontProductPage.url($$createConfigProduct.custom_attributes[url_key]$$-1)}}" stepKey="amOnSimpleProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoadOnStorefront"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$-Updated" stepKey="seeConfigurableProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeConfigurableProductName"> + <argument name="value" value="$$createConfigProduct.name$$-Updated"/> + </actionGroup> <see userInput="{{productAttributeColor.default_label}}" selector="{{StorefrontProductInfoMainSection.productAttributeTitle1}}" stepKey="seeColorAttributeName"/> <selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="{{colorConfigurableProductAttribute1.name}}" stepKey="selectFirstOption"/> <see userInput="{{virtualProductWithRequiredFields.price}}" selector="{{StorefrontProductInfoMainSection.productPrice}}" stepKey="assertFirstOptionProductPrice"/> diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml index b9c558c65c513..5cf38814a914c 100644 --- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml +++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml @@ -80,7 +80,9 @@ <!-- Go to product visible --> <amOnPage url="$$createProduct.custom_attributes[url_key]$$.html" stepKey="navigateToProductPageOnDefaultStore"/> - <see userInput="$$createProduct.name$$" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertFirstProductNameTitle"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="assertFirstProductNameTitle"> + <argument name="value" value="$$createProduct.name$$"/> + </actionGroup> <!--Add a product to the cart--> <actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml index 1c573ddef79a7..f49308e76e2f3 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminCreateDownloadableProductWithManageStockTest.xml @@ -102,7 +102,9 @@ <!-- Assert product is out of stock in store front --> <amOnPage url="{{DownloadableProduct.urlKey}}.html" stepKey="navigateToProductPage"/> <waitForPageLoad stepKey="waitForProductPageLoad"/> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{DownloadableProduct.name}}" stepKey="seeProductNameInStoreFront"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductNameInStoreFront"> + <argument name="value" value="{{DownloadableProduct.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="OUT OF STOCK" stepKey="seeProductStatusInStoreFront"/> </test> </tests> diff --git a/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithFileLinksTest.xml b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithFileLinksTest.xml index 441395e3114a9..af531497e2957 100644 --- a/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithFileLinksTest.xml +++ b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithFileLinksTest.xml @@ -173,7 +173,9 @@ <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> <argument name="productUrl" value="{{ImportProduct_Downloadable_FileLinks.urlKey}}"/> </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Downloadable_FileLinks.name}}" stepKey="seeProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName"> + <argument name="value" value="{{ImportProduct_Downloadable_FileLinks.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Downloadable_FileLinks.sku}}" stepKey="seeSku"/> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProduct_Downloadable_FileLinks.price}}" stepKey="seePrice"/> <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Downloadable_FileLinks.baseImageName)}}" stepKey="seeBaseImage"/> diff --git a/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithUrlLinksTest.xml b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithUrlLinksTest.xml index 22cfca5224ad6..8c04ac3e82415 100644 --- a/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithUrlLinksTest.xml +++ b/app/code/Magento/DownloadableImportExport/Test/Mftf/Test/AdminImportDownloadableProductsWithUrlLinksTest.xml @@ -181,7 +181,9 @@ <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> <argument name="productUrl" value="{{ImportProduct_Downloadable_UrlLinks.urlKey}}"/> </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Downloadable_UrlLinks.name}}" stepKey="seeProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName"> + <argument name="value" value="{{ImportProduct_Downloadable_UrlLinks.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Downloadable_UrlLinks.sku}}" stepKey="seeSku"/> <see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="${{ImportProduct_Downloadable_UrlLinks.price}}" stepKey="seePrice"/> <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProduct_Downloadable_UrlLinks.baseImageName)}}" stepKey="seeBaseImage"/> diff --git a/app/code/Magento/GroupedImportExport/Test/Mftf/Test/AdminImportGroupedProductTest.xml b/app/code/Magento/GroupedImportExport/Test/Mftf/Test/AdminImportGroupedProductTest.xml index d02764c09a50e..fd30f4bf488b6 100644 --- a/app/code/Magento/GroupedImportExport/Test/Mftf/Test/AdminImportGroupedProductTest.xml +++ b/app/code/Magento/GroupedImportExport/Test/Mftf/Test/AdminImportGroupedProductTest.xml @@ -244,7 +244,9 @@ <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefrontPage"> <argument name="productUrl" value="{{ImportProduct_Grouped.urlKey}}"/> </actionGroup> - <see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{ImportProduct_Grouped.name}}" stepKey="seeProductName"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="seeProductName"> + <argument name="value" value="{{ImportProduct_Grouped.name}}"/> + </actionGroup> <see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="{{ImportProduct_Grouped.sku}}" stepKey="seeSku"/> <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple1_Grouped.baseImageName)}}" stepKey="seeProduct1BaseImage"/> <seeElement selector="{{StorefrontProductInfoMainSection.productImageSrc(ImportProductSimple2_Grouped.baseImageName)}}" stepKey="seeProduct2BaseImage"/> diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml index 129c8c267de43..d1a3f9f511027 100644 --- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml +++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontAddMultipleStoreProductsToWishlistTest.xml @@ -104,7 +104,9 @@ <click selector="{{StorefrontFooterSection.storeLink($$storeGroup.group[name]$$)}}" stepKey="selectSecondStoreToSwitchOn"/> <!-- Verify that both products are visible in wishlist on both stores --> <amOnPage url="{{StorefrontProductPage.url($$secondProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToProductPageOnSecondStore"/> - <see userInput="$$secondProduct.name$$" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertSecondProductNameTitle"/> + <actionGroup ref="AssertStorefrontProductInfoMainProductNameActionGroup" stepKey="assertSecondProductNameTitle"> + <argument name="value" value="$$secondProduct.name$$"/> + </actionGroup> <click selector="{{StorefrontProductPageSection.addToWishlist}}" stepKey="addSecondProductToWishlist"/> <see userInput="$$secondProduct.name$$" selector="{{StorefrontCustomerWishlistSection.productItemNameText}}" stepKey="seeProduct2InWishlistOnSecondStore"/> <click selector="{{StorefrontFooterSection.switchStoreButton}}" stepKey="clickSwitchStoreButtonOnSecondStore"/> From ef5cd8cbf69786329c2aa61565ec600e3d5d674f Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 5 Oct 2021 14:10:58 +0300 Subject: [PATCH 19/35] refactored MoveRecentlyViewedBundleFixedProductOnOrderPageTest --- ...eateOrderOnEditCustomerPageActionGroup.xml | 21 ++++++++ ...rderedGridOnCreateOrderPageActionGroup.xml | 23 ++++++++ ...ureForRecentlyViewedProductActionGroup.xml | 22 ++++++++ ...onfigureProductSlidingModalActionGroup.xml | 20 +++++++ ...onfigureProductSlidingModalActionGroup.xml | 21 ++++++++ ...iewedBundleFixedProductOnOrderPageTest.xml | 53 +++++++++---------- 6 files changed, 132 insertions(+), 28 deletions(-) create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminClickCreateOrderOnEditCustomerPageActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickConfigureForRecentlyViewedProductActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickOkOnConfigureProductSlidingModalActionGroup.xml create mode 100644 app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSelectDropdownOptionOnConfigureProductSlidingModalActionGroup.xml diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminClickCreateOrderOnEditCustomerPageActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminClickCreateOrderOnEditCustomerPageActionGroup.xml new file mode 100644 index 0000000000000..1fdf5e008e5f2 --- /dev/null +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminClickCreateOrderOnEditCustomerPageActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + + <actionGroup name="AdminClickCreateOrderOnEditCustomerPageActionGroup"> + <annotations> + <description>Clicks on 'Create Order' on the Edit Customer page.</description> + </annotations> + + <click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/> + <waitForPageLoad stepKey="waitForPageLoaded"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup.xml new file mode 100644 index 0000000000000..f27e99c7ce3b1 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup"> + <annotations> + <description>Asserts product in Items Ordered Grid on Create Order page</description> + </annotations> + <arguments> + <argument name="index" type="string"/> + <argument name="attribute" type="string"/> + <argument name="value" type="string"/> + </arguments> + + <see selector="{{AdminCustomerCreateNewOrderSection.gridCell(index, attribute)}}" userInput="{{value}}" stepKey="seeProductAttribute"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickConfigureForRecentlyViewedProductActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickConfigureForRecentlyViewedProductActionGroup.xml new file mode 100644 index 0000000000000..5bf954e4c8460 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickConfigureForRecentlyViewedProductActionGroup.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickConfigureForRecentlyViewedProductActionGroup"> + <annotations> + <description>Clicks the "Configure" button for a Product in Recently Viewed Product section on Create Order Page</description> + </annotations> + <arguments> + <argument name="productName" type="string"/> + </arguments> + + <click selector="{{AdminCustomerActivitiesRecentlyViewedSection.addToOrderConfigure(productName)}}" stepKey="clickConfigureProduct"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickOkOnConfigureProductSlidingModalActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickOkOnConfigureProductSlidingModalActionGroup.xml new file mode 100644 index 0000000000000..486751dc09e3a --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminClickOkOnConfigureProductSlidingModalActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickOkOnConfigureProductSlidingModalActionGroup"> + <annotations> + <description>Clicks the "Ok" button on the "Configure Product" sliding modal on the Create Order page</description> + </annotations> + + <click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkButton"/> + <waitForPageLoad stepKey="waitForAddingConfiguredProduct"/> + + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSelectDropdownOptionOnConfigureProductSlidingModalActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSelectDropdownOptionOnConfigureProductSlidingModalActionGroup.xml new file mode 100644 index 0000000000000..0a01d81aec725 --- /dev/null +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminSelectDropdownOptionOnConfigureProductSlidingModalActionGroup.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminSelectDropdownOptionOnConfigureProductSlidingModalActionGroup"> + <annotations> + <description>Selects a required option in dropdown on the "Configure Product" Sliding Modal</description> + </annotations> + <arguments> + <argument name="optionName" type="string"/> + </arguments> + + <selectOption selector="{{AdminOrderFormConfigureProductSection.selectOption}}" userInput="{{optionName}}" stepKey="selectOption"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml index 5b7888fe9e4bb..5fa26aff0f737 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml @@ -20,16 +20,12 @@ <group value="mtf_migrated"/> </annotations> <before> - <!-- Login as admin --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> - <!-- Create customer --> <createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> - <!-- Create category --> <createData entity="SimpleSubCategory" stepKey="createCategory"/> - <!-- Create simple products --> <createData entity="SimpleProduct2" stepKey="createFirstProduct"> <field key="price">755.00</field> </createData> @@ -37,7 +33,6 @@ <field key="price">756.00</field> </createData> - <!-- Create Bundle product --> <createData entity="BundleProductPriceViewRange" stepKey="createBundleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> @@ -54,62 +49,64 @@ <requiredEntity createDataKey="createBundleOption"/> <requiredEntity createDataKey="createSecondProduct"/> </createData> - <!-- Change configuration --> + <magentoCLI command="config:set reports/options/enabled 1" stepKey="enableReportModule"/> <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> </before> <after> - <!-- Admin logout --> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> - <!-- Customer logout --> <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> - <!-- Delete customer --> <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> - <!-- Delete created product data --> <deleteData createDataKey="createBundleProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/> <deleteData createDataKey="createSecondProduct" stepKey="deleteSecondProduct"/> - <!-- Delete category --> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> - <!-- Change configuration --> <magentoCLI command="config:set reports/options/enabled 0" stepKey="disableReportModule"/> </after> - <!-- Login as customer --> <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> <argument name="Customer" value="$$createCustomer$$"/> </actionGroup> - <!-- Go to created product page --> - <amOnPage url="{{StorefrontProductPage.url($$createBundleProduct.custom_attributes[url_key]$$)}}" stepKey="goToProductPage"/> - <waitForPageLoad stepKey="waitForProductPageLoad"/> + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="goToProductPage"> + <argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/> + </actionGroup> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProductPageLoad"/> - <!-- Search and open customer --> <actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterCreatedCustomer"> <argument name="email" value="$$createCustomer.email$$"/> </actionGroup> <actionGroup ref="AdminClickFirstRowEditLinkOnCustomerGridActionGroup" stepKey="clickEditButton"/> - <!-- Click create order --> - <click selector="{{AdminCustomerMainActionsSection.createOrderBtn}}" stepKey="clickCreateOrder"/> + <actionGroup ref="AdminClickCreateOrderOnEditCustomerPageActionGroup" stepKey="clickCreateOrder"/> + + <actionGroup ref="AdminClickConfigureForRecentlyViewedProductActionGroup" stepKey="configureProduct"> + <argument name="productName" value="$$createBundleProduct.name$$"/> + </actionGroup> + <actionGroup ref="AdminSelectDropdownOptionOnConfigureProductSlidingModalActionGroup" stepKey="selectProductOption"> + <argument name="optionName" value="$$createFirstProduct.name$$"/> + </actionGroup> - <!-- Add configure to bundle product --> - <click selector="{{AdminCustomerActivitiesRecentlyViewedSection.addToOrderConfigure($$createBundleProduct.name$$)}}" stepKey="configureProduct"/> - <click selector="{{AdminCustomerActivitiesConfigureSection.dropdownProductSelection($$createFirstProduct.name$$)}}" stepKey="selectProductOption"/> - <click selector="{{AdminCustomerActivitiesConfigureSection.okButton}}" stepKey="clickOkBtn"/> - <waitForPageLoad stepKey="waitForAddingConfigure"/> + <actionGroup ref="AdminClickOkOnConfigureProductSlidingModalActionGroup" stepKey="clickOkBtn"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForAddingConfigure"/> - <!-- Click 'Update Changes' --> <actionGroup ref="AdminClickUpdateChangesOnCreateOrderPageActionGroup" stepKey="clickUpdateChangesBtn"/> - <!-- Assert products in items ordered grid --> - <see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Product')}}" userInput="$$createBundleProduct.name$$" stepKey="seeProductName"/> - <see selector="{{AdminCustomerCreateNewOrderSection.gridCell('1', 'Price')}}" userInput="$755.00" stepKey="seeProductPrice"/> + <actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductName"> + <argument name="index" value="1"/> + <argument name="attribute" value="Product"/> + <argument name="value" value="$$createBundleProduct.name$$"/> + </actionGroup> + <actionGroup ref="AdminAssertProductInItemsOrderedGridOnCreateOrderPageActionGroup" stepKey="seeProductPrice"> + <argument name="index" value="1"/> + <argument name="attribute" value="Price"/> + <argument name="value" value="$755.00"/> + </actionGroup> </test> </tests> From e7b07ba5802c6a0c008c4f930c380b5f3f616710 Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Thu, 4 Nov 2021 16:39:32 +0200 Subject: [PATCH 20/35] Refactoring-AdminUpdateStoreViewTest --- .../Mftf/Test/AdminUpdateStoreViewTest.xml | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml index b4aac676f2bc9..d56d554da3794 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml @@ -64,17 +64,24 @@ </actionGroup> <!--Go to store configuration page and verify AssertStoreBackend--> - <amOnPage url="{{AdminConfigPage.url}}" stepKey="goToConfigStoreConfigurationPage"/> - <waitForPageLoad stepKey="waitForSystemStoreConfigurationPageLoad" /> - <click selector="{{AdminConfigSection.defaultConfigButton}}" stepKey="clickDefaultConfigButton"/> - <see selector="{{AdminConfigSection.defaultConfigDropdown}}" userInput="{{storeViewData.name}}" stepKey="seeAssertStoreViewInDefaultConfigDropdown"/> - <see selector="{{AdminConfigSection.defaultConfigDropdown}}" userInput="{{SecondStoreUnique.name}}" stepKey="seeAssertUpdateStoreViewInDefaultConfigDropdown"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToConfigStoreConfigurationPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSystemStoreConfigurationPageLoad"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickDefaultConfigButton"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeAssertStoreViewInDefaultConfigDropdown"/> + <actionGroup ref="AssertStoreConfigurationBackendActionGroup" stepKey="seeAssertUpdateStoreViewInDefaultConfigDropdown"> + <argument name="storeView1" value="{{storeViewData.name}}"/> + <argument name="storeView2" value="{{SecondStoreUnique.name}}"/> + </actionGroup> <!--Go to storefront and verify AssertStoreFrontend--> - <actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="goToStorefrontPage"/> - <click selector="{{StorefrontHeaderSection.storeViewSwitcher}}" stepKey="selectStoreSwitcher"/> - <waitForPageLoad stepKey="waitForFirstStoreView"/> - <see selector="{{StorefrontHeaderSection.storeViewDropdown}}" userInput="{{storeViewData.name}}" stepKey="seeAssertStoreViewOnStorefront"/> - <see selector="{{StorefrontHeaderSection.storeViewDropdown}}" userInput="{{SecondStoreUnique.name}}" stepKey="seeAssertUpdatedStoreViewOnStorefront"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="goToStorefrontPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectStoreSwitcher"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForFirstStoreView"/> + <actionGroup ref="AssertStorefrontStoreVisibleInHeaderActionGroup" stepKey="seeAssertStoreViewOnStorefront"> + <argument name="store" value="{{storeViewData.name}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontStoreVisibleInHeaderActionGroup" stepKey="seeAssertUpdatedStoreViewOnStorefront"> + <argument name="store" value="{{SecondStoreUnique.name}}"/> + </actionGroup> </test> </tests> From f2daffdc95a9cf1f7220b08c8f887e1d049350ea Mon Sep 17 00:00:00 2001 From: Ravi Chandra <ravi.chandra@krishtechnolabs.com> Date: Fri, 12 Nov 2021 09:36:41 +0530 Subject: [PATCH 21/35] Add README file for CatalogUrlRewrite, update README file for Developer and Csp module --- app/code/Magento/CatalogUrlRewrite/README.md | 11 +++++++++++ app/code/Magento/Csp/README.md | 9 +++++++++ app/code/Magento/Developer/README.md | 10 ++++++++++ 3 files changed, 30 insertions(+) create mode 100644 app/code/Magento/CatalogUrlRewrite/README.md diff --git a/app/code/Magento/CatalogUrlRewrite/README.md b/app/code/Magento/CatalogUrlRewrite/README.md new file mode 100644 index 0000000000000..c0e605da6d2c1 --- /dev/null +++ b/app/code/Magento/CatalogUrlRewrite/README.md @@ -0,0 +1,11 @@ +# Magento_CatalogUrlRewrite module + +This module generate url rewrite fields for catalog and product. + +## Extensibility + +Extension developers can interact with the Magento_CatalogUrlRewrite module. For more information about the Magento extension mechanism, see [Magento plugins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_CatalogUrlRewrite module. + +A lot of functionality in the module is on JavaScript, use [mixins](https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/javascript/js_mixins.html) to extend it. \ No newline at end of file diff --git a/app/code/Magento/Csp/README.md b/app/code/Magento/Csp/README.md index 47f0f196becd5..5a7305ca073f0 100644 --- a/app/code/Magento/Csp/README.md +++ b/app/code/Magento/Csp/README.md @@ -1,2 +1,11 @@ +# Magento_Csp module Magento_Csp implements Content Security Policies for Magento. Allows CSP configuration for Merchants, provides a way for extension and theme developers to configure CSP headers for their extensions. + +## Extensibility + +Extension developers can interact with the Magento_Csp module. For more information about the Magento extension mechanism, see [Magento plugins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Csp module. + +A lot of functionality in the module is on JavaScript, use [mixins](https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/javascript/js_mixins.html) to extend it. diff --git a/app/code/Magento/Developer/README.md b/app/code/Magento/Developer/README.md index c3bd8e9983561..f0ccdb7217ec7 100644 --- a/app/code/Magento/Developer/README.md +++ b/app/code/Magento/Developer/README.md @@ -1 +1,11 @@ +# Magento_Developer module + The Magento_Developer module provides functionality to make it easier to develop in Magento 2. + +## Extensibility + +Extension developers can interact with the Magento_Developer module. For more information about the Magento extension mechanism, see [Magento plugins](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html). + +[The Magento dependency injection mechanism](https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html) enables you to override the functionality of the Magento_Developer module. + +A lot of functionality in the module is on JavaScript, use [mixins](https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/javascript/js_mixins.html) to extend it. \ No newline at end of file From 757638f3190107558481132e3445dd6f8a87537e Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Fri, 12 Nov 2021 17:08:09 +0200 Subject: [PATCH 22/35] fixed semantic --- .../MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml index bc175ef744071..a8caf2d4a5adc 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/MoveRecentlyViewedBundleFixedProductOnOrderPageTest.xml @@ -79,14 +79,8 @@ </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForProductPageLoad"/> -<<<<<<< HEAD - <actionGroup ref="AdminFilterCustomerByEmail" stepKey="filterCreatedCustomer"> - <argument name="email" value="$$createCustomer.email$$"/> -======= - <!-- Search and open customer --> <actionGroup ref="AdminOpenCustomerEditPageActionGroup" stepKey="openCustomerEditPage"> <argument name="customerId" value="$createCustomer.id$"/> ->>>>>>> 2.4-develop </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterCreatedCustomer"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickEditButton"/> From a9ed32efa67030c14a64d9307ffb2a1af73a1bcb Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Thu, 11 Nov 2021 14:34:28 +0200 Subject: [PATCH 23/35] Refactoring-AdminCreateCategoryWithFiveNestingTest --- ...inClickAddSubcategoryButtonActionGroup.xml | 14 +++++++++ ...AdminCreateCategoryWithFiveNestingTest.xml | 30 ++++++++++++------- 2 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickAddSubcategoryButtonActionGroup.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickAddSubcategoryButtonActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickAddSubcategoryButtonActionGroup.xml new file mode 100644 index 0000000000000..b426067eac316 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminClickAddSubcategoryButtonActionGroup.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> + <actionGroup name="AdminClickAddSubcategoryButtonActionGroup"> + <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton"/> + </actionGroup> +</actionGroups> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml index fcffd272a2fe4..a711228e659b1 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithFiveNestingTest.xml @@ -37,33 +37,43 @@ <!--Create Category with Five Nesting --> <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/> <!--Create Nested First Category--> - <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton"/> + <actionGroup ref="AdminClickAddSubcategoryButtonActionGroup" stepKey="clickOnAddSubCategoryButton"/> <checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableCategory"/> - <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{FirstLevelSubCat.name}}" stepKey="fillFirstSubCategoryName"/> + <actionGroup ref="AdminChangeCategoryNameActionGroup" stepKey="fillFirstSubCategoryName"> + <argument name="categoryName" value="{{FirstLevelSubCat.name}}"/> + </actionGroup> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveFirstSubCategory"/> <!-- Verify success message --> <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertSuccessMessage"/> <!--Create Nested Second Sub Category--> - <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton1"/> - <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SecondLevelSubCat.name}}" stepKey="fillSecondSubCategoryName"/> + <actionGroup ref="AdminClickAddSubcategoryButtonActionGroup" stepKey="clickOnAddSubCategoryButton1"/> + <actionGroup ref="AdminChangeCategoryNameActionGroup" stepKey="fillSecondSubCategoryName"> + <argument name="categoryName" value="{{SecondLevelSubCat.name}}"/> + </actionGroup> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSecondSubCategory"/> <!-- Verify success message --> <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertSuccessMessage1"/> <!--Create Nested Third Sub Category/>--> - <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton2"/> - <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{ThirdLevelSubCat.name}}" stepKey="fillThirdSubCategoryName"/> + <actionGroup ref="AdminClickAddSubcategoryButtonActionGroup" stepKey="clickOnAddSubCategoryButton2"/> + <actionGroup ref="AdminChangeCategoryNameActionGroup" stepKey="fillThirdSubCategoryName"> + <argument name="categoryName" value="{{ThirdLevelSubCat.name}}"/> + </actionGroup> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveThirdSubCategory"/> <!-- Verify success message --> <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertSuccessMessage2"/> <!--Create Nested fourth Sub Category />--> - <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton3"/> - <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{FourthLevelSubCat.name}}" stepKey="fillFourthSubCategoryName"/> + <actionGroup ref="AdminClickAddSubcategoryButtonActionGroup" stepKey="clickOnAddSubCategoryButton3"/> + <actionGroup ref="AdminChangeCategoryNameActionGroup" stepKey="fillFourthSubCategoryName"> + <argument name="categoryName" value="{{FourthLevelSubCat.name}}"/> + </actionGroup> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveFourthSubCategory"/> <!-- Verify success message --> <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertSuccessMessage3"/> <!--Create Nested fifth Sub Category />--> - <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton4"/> - <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{FifthLevelCat.name}}" stepKey="fillFifthSubCategoryName"/> + <actionGroup ref="AdminClickAddSubcategoryButtonActionGroup" stepKey="clickOnAddSubCategoryButton4"/> + <actionGroup ref="AdminChangeCategoryNameActionGroup" stepKey="fillFifthSubCategoryName"> + <argument name="categoryName" value="{{FifthLevelCat.name}}"/> + </actionGroup> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveFifthLevelCategory"/> <!-- Verify success message --> <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertSuccessMessage4"/> From 655b16d0b445b6c0394365ef2b7c9e1c35bf24f8 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Thu, 16 Dec 2021 15:59:31 +0200 Subject: [PATCH 24/35] replace click by action group --- ...nCreateSimpleProductWithDatetimeAttributeTest.xml | 2 +- .../AdminMoveCategoryAndCheckUrlRewritesTest.xml | 12 ++++++------ ...veCategoryToAnotherPositionInCategoryTreeTest.xml | 8 ++++---- ...inUpdateCategoryWithInactiveIncludeInMenuTest.xml | 3 +-- .../AdminCheckValidatorConfigurableProductTest.xml | 2 +- ...eProductWithSeveralAttributesPrependMediaTest.xml | 4 ++-- ...eLastReviewDateForReviewsByProductsReportTest.xml | 4 ++-- .../Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml | 4 ++-- ...efrontSwatchAttributeDisplayedInWidgetCMSTest.xml | 2 +- .../AdminUrlRewritesForProductAfterImportTest.xml | 4 ++-- 10 files changed, 22 insertions(+), 23 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml index 47c7868b24002..0ffcc10259603 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithDatetimeAttributeTest.xml @@ -62,7 +62,7 @@ <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openProductFilters"/> <fillField selector="{{AdminProductGridFilterSection.inputByCodeRangeFrom($createDatetimeAttribute.attribute_code$)}}" userInput="{$generateDefaultValue}" stepKey="fillProductDatetimeFromFilter"/> <fillField selector="{{AdminProductGridFilterSection.inputByCodeRangeTo($createDatetimeAttribute.attribute_code$)}}" userInput="{$generateFilterToDate}" stepKey="fillProductDatetimeToFilter"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickApplyFilters"/> <see selector="{{AdminDataGridTableSection.gridCell('1', 'Name')}}" userInput="{{_defaultProduct.name}}" stepKey="checkAppliedDatetimeFilter"/> <see selector="{{AdminDataGridTableSection.rowTemplateStrict(_defaultProduct.name)}}" userInput="{$generateDefaultGridValue}" stepKey="checkDefaultValueInGrid"/> </test> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml index 96f905c3d916e..efd2a54fc5133 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryAndCheckUrlRewritesTest.xml @@ -58,8 +58,8 @@ <!--Search third level category Redirect Path, Target Path and Redirect Type--> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/> <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="{{SimpleSubCategory.name_lwr}}" stepKey="fillRequestPathFilter"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> - <waitForPageLoad stepKey="waitForPageToLoad0"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickOrderApplyFilters"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageToLoad0"/> <!--Verify Category RedirectType--> <see stepKey="verifyTheRedirectType" selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Redirect Type')}}" userInput="No" /> @@ -86,8 +86,8 @@ <waitForPageLoad stepKey="waitForUrlRewritePage1"/> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters1"/> <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="{{FirstLevelSubCat.name_lwr}}2/{{SimpleSubCategory.name_lwr}}.html" stepKey="fillCategoryUrlKey1"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters1"/> - <waitForPageLoad stepKey="waitForPageToLoad4"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickOrderApplyFilters1"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageToLoad4"/> <!--Verify new Redirect Path after move --> <see stepKey="verifyTheRequestPathAfterMove" selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Request Path')}}" userInput="{{FirstLevelSubCat.name_lwr}}2/{{SimpleSubCategory.name_lwr}}.html" /> @@ -101,8 +101,8 @@ <!--Verify before move Redirect Path displayed with associated Target Path and Redirect Type--> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters2"/> <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="{{SimpleSubCategory.name_lwr}}" stepKey="fillCategoryUrlKey2"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters2"/> - <waitForPageLoad stepKey="waitForPageToLoad5"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickOrderApplyFilters2"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageToLoad5"/> <see stepKey="verifyTheRedirectTypeAfterMove1" selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Redirect Type')}}" userInput="Permanent (301)" /> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml index c81e47a841891..9eba952c1a3b2 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminMoveCategoryToAnotherPositionInCategoryTreeTest.xml @@ -98,8 +98,8 @@ <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/> <waitForElementVisible selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" stepKey="waitForCategoryUrlKey"/> <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="{{SecondLevelSubCat.name_lwr}}.html" stepKey="fillCategoryUrlKey"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> - <waitForPageLoad stepKey="waitForSearch"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickOrderApplyFilters"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch"/> <!-- Verify new Redirect Path after move --> <see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('2', 'Request Path')}}" userInput="{{SecondLevelSubCat.name_lwr}}.html" stepKey="verifyTheRequestPathAfterMove"/> <!-- Verify new Target Path after move --> @@ -110,8 +110,8 @@ <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters1"/> <waitForElementVisible selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" stepKey="waitForTheCategoryUrlKey"/> <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="{{SecondLevelSubCat.name_lwr}}" stepKey="fillTheCategoryUrlKey"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters1"/> - <waitForPageLoad stepKey="waitForSearch1"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickOrderApplyFilters1"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForSearch1"/> <see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Redirect Type')}}" userInput="Permanent (301)" stepKey="verifyTheRedirectTypeBeforeMove"/> <see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Request Path')}}" userInput="{{_defaultCategory.name_lwr}}2/{{FirstLevelSubCat.name_lwr}}/{{SecondLevelSubCat.name_lwr}}.html" stepKey="verifyTheRequestPathBeforeMove"/> <see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Target Path')}}" userInput="{{SecondLevelSubCat.name_lwr}}.html" stepKey="verifyTheTargetPathBeforeMove"/> diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml index 1a82a1eca8fa6..212a148f3f3c3 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml @@ -55,8 +55,7 @@ <!--Verify Updated Category UrlKey--> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/> <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="{{SimpleRootSubCategory.url_key}}" stepKey="fillUpdatedCategoryUrlKey"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> - <waitForPageLoad stepKey="waitForPageToLoad"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickOrderApplyFilters"/> <see stepKey="seeCategoryUrlKey" selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Request Path')}}" userInput="{{SimpleRootSubCategory.url_key}}.html" /> <!--Verify Updated Category UrlKey directs to category Store Front--> <amOnPage url="{{SimpleRootSubCategory.url_key}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml index b9e331bbfe5b4..4f324618c29dd 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCheckValidatorConfigurableProductTest.xml @@ -84,7 +84,7 @@ <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="clickOnFilters"/> <fillField selector="{{AdminDataGridHeaderSection.attributeCodeFilterInput}}" userInput="{{productDropDownAttribute.attribute_code}}" stepKey="fillFilterAttributeCodeField"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickApplyFiltersButton"/> <click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="clickOnFirstCheckbox"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep1"/> <waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(productDropDownAttribute.attribute_code)}}" stepKey="waitForNextPageOpened"/> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontGalleryConfigurableProductWithSeveralAttributesPrependMediaTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontGalleryConfigurableProductWithSeveralAttributesPrependMediaTest.xml index 3e74edfb68074..c69c05e2976cb 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontGalleryConfigurableProductWithSeveralAttributesPrependMediaTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontGalleryConfigurableProductWithSeveralAttributesPrependMediaTest.xml @@ -55,13 +55,13 @@ <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearAttributeGridFiltersToFindDropdownAttribute"/> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openFiltersPaneForDropdownAttribute"/> <fillField selector="{{AdminDataGridHeaderSection.attributeCodeFilterInput}}" userInput="$createDropdownAttribute.attribute_code$" stepKey="fillAttributeCodeFilterFieldForDropdownAttribute"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButtonForDropdownAttribute"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickApplyFiltersButtonForDropdownAttribute"/> <click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="selectDropdownAttribute"/> <!-- Find Swatch attribute in grid and select it --> <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearAttributeGridFiltersToFindSwatchAttribute"/> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openFiltersPaneForSwatchAttribute"/> <fillField selector="{{AdminDataGridHeaderSection.attributeCodeFilterInput}}" userInput="$createVisualSwatchAttribute.attribute_code$" stepKey="fillAttributeCodeFilterFieldForSwatchAttribute"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButtonForSwatchAttribute"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickApplyFiltersButtonForSwatchAttribute"/> <click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="selectSwatchAttribute"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextToSelectOptions"/> diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml index 1b997715a5738..203376db0f021 100644 --- a/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml +++ b/app/code/Magento/Review/Test/Mftf/Test/AdminValidateLastReviewDateForReviewsByProductsReportTest.xml @@ -76,8 +76,8 @@ <waitForPageLoad stepKey="waitForReviewListPageToLoad"/> <!--Step8. Assert product last review date matches latest user review date--> <fillField selector="{{AdminReviewGridSection.nickname}}" userInput="{{secondSimpleProductReview.nickname}}" stepKey="fillNickname"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFilters"/> - <waitForPageLoad stepKey="waitForGridViewPageToLoad"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickApplyFilters"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForGridViewPageToLoad"/> <grabTextFrom selector="{{AdminCreateNewReviewSection.grabLatestUserReviewDate}}" stepKey="grabLatestUserReviewDate"/> <assertEquals stepKey="assertReviewDate"> <actualResult type="string">$grabLastReviewDate</actualResult> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml index d0bf3958179d4..4cd220535819a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -212,14 +212,14 @@ <actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilterBeforeOrderDateFilter" after="filterOrderGridByDateComment"/> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderFilterForOrderDateFrom" after="clearFilterBeforeOrderDateFilter"/> <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[from]')}}" userInput="01/01/2018" stepKey="fillOrderDateFromFilter" after="openOrderFilterForOrderDateFrom"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="applyFilterOrderDateFrom" after="fillOrderDateFromFilter"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyFilterOrderDateFrom" after="fillOrderDateFromFilter"/> <!--Both of our orders should be in grid--> <see selector="{{AdminDataGridTableSection.column('Bill')}}" userInput="{{Simple_US_Customer.fullname}}" stepKey="seeFirstOrderInGrid" after="applyFilterOrderDateFrom"/> <see selector="{{AdminDataGridTableSection.column('Bill')}}" userInput="{{BillingAddressTX.fullname}}" stepKey="seeSecondOrderInGrid" after="seeFirstOrderInGrid"/> <!--Add end date to date range filter (past date)--> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openOrderFilterForOrderDateTo" after="seeSecondOrderInGrid"/> <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('created_at[to]')}}" userInput="01/10/2018" stepKey="fillOrderDateToFilter" after="openOrderFilterForOrderDateTo"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="applyFilterOrderDateTo" after="fillOrderDateToFilter"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="applyFilterOrderDateTo" after="fillOrderDateToFilter"/> <!--Dont see our orders in the grid--> <dontSee selector="{{AdminDataGridTableSection.column('Bill')}}" userInput="{{Simple_US_Customer.fullname}}" stepKey="dontSeeFirstOrderInGrid" after="applyFilterOrderDateTo"/> <dontSee selector="{{AdminDataGridTableSection.column('Bill')}}" userInput="{{BillingAddressTX.fullname}}" stepKey="dontSeeSecondOrderInGrid" after="dontSeeFirstOrderInGrid"/> diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributeDisplayedInWidgetCMSTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributeDisplayedInWidgetCMSTest.xml index 897f7352a504c..c87dbc638270f 100644 --- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributeDisplayedInWidgetCMSTest.xml +++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributeDisplayedInWidgetCMSTest.xml @@ -52,7 +52,7 @@ <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearAttributeGridFiltersToFindSwatchAttribute"/> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openFiltersPaneForSwatchAttribute"/> <fillField selector="{{AdminDataGridHeaderSection.attributeCodeFilterInput}}" userInput="$createVisualSwatchAttribute.attribute_code$" stepKey="fillAttributeCodeFilterFieldForSwatchAttribute"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButtonForSwatchAttribute"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickApplyFiltersButtonForSwatchAttribute"/> <click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="selectSwatchAttribute"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextToSelectOptions"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductAfterImportTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductAfterImportTest.xml index 006c01c23da0b..fbeb0081018f1 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductAfterImportTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductAfterImportTest.xml @@ -80,7 +80,7 @@ <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="amOnUrlRewriteIndexPage"/> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/> <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="$createSimpleProduct.custom_attributes[url_key]$.html" stepKey="inputProductName"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickSearchButton"/> <seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue1"/> <seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue2"/> <seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$.html)}}" stepKey="seeValue3"/> @@ -102,7 +102,7 @@ <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="amOnUrlRewriteIndexPage2"/> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters2"/> <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="$createSimpleProduct.custom_attributes[url_key]$-new.html" stepKey="inputProductName2"/> - <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearchButton2"/> + <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickSearchButton2"/> <seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $createSimpleProduct.custom_attributes[url_key]$-new.html)}}" stepKey="seeInListValue1"/> <seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$-new.html)}}" stepKey="seeInListValue2"/> <seeElement selector="{{AdminUrlRewriteIndexSection.gridCellByColumnValue('Request Path', $simpleSubCategory1.custom_attributes[url_key]$/$simpleSubCategory2.custom_attributes[url_key]$/$createSimpleProduct.custom_attributes[url_key]$-new.html)}}" stepKey="seeInListValue3"/> From ab6f3edc2ad4ec72e74d62439e94ef451ade604e Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Thu, 16 Dec 2021 16:03:37 +0200 Subject: [PATCH 25/35] add BC --- .../Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml index 212a148f3f3c3..1bd48ca89a5de 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateCategoryWithInactiveIncludeInMenuTest.xml @@ -56,6 +56,7 @@ <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/> <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="{{SimpleRootSubCategory.url_key}}" stepKey="fillUpdatedCategoryUrlKey"/> <actionGroup ref="AdminClickSearchInGridActionGroup" stepKey="clickOrderApplyFilters"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageToLoad"/> <see stepKey="seeCategoryUrlKey" selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Request Path')}}" userInput="{{SimpleRootSubCategory.url_key}}.html" /> <!--Verify Updated Category UrlKey directs to category Store Front--> <amOnPage url="{{SimpleRootSubCategory.url_key}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> From 99ab3172ad624bd940f6282a93d18dbd96a3a67f Mon Sep 17 00:00:00 2001 From: engcom-Charlie <engcom-vendorworker-charlie@adobe.com> Date: Fri, 17 Dec 2021 16:43:11 +0530 Subject: [PATCH 26/35] 32758-Modified the title and added testCaseId in test annotation --- .../User/Test/Mftf/Test/AdminUnlockAdminUserEntityTest.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminUnlockAdminUserEntityTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminUnlockAdminUserEntityTest.xml index 2f8bf959b5c49..df8e8fe77ddbc 100644 --- a/app/code/Magento/User/Test/Mftf/Test/AdminUnlockAdminUserEntityTest.xml +++ b/app/code/Magento/User/Test/Mftf/Test/AdminUnlockAdminUserEntityTest.xml @@ -12,9 +12,10 @@ <annotations> <features value="User"/> <stories value="Unlock admin user, locked during login"/> - <title value="Unlock admin when the user was locked after entering incorrect password specified number of times"/> + <title value="Unlock admin from admin grid when the user was locked after entering incorrect password specified number of times"/> <description value="Unlocked user should be able login into admin panel"/> <severity value="MAJOR"/> + <testCaseId value="AC-2009"/> <group value="user"/> </annotations> <before> From 0111aa2e3be832638f1a628dd5799a1fe0558cea Mon Sep 17 00:00:00 2001 From: Kate Kyzyma <kate@atwix.com> Date: Thu, 23 Dec 2021 09:37:36 +0200 Subject: [PATCH 27/35] Refactoring-AdminCreateCategoryWithAnchorFieldTest --- ...AdminCreateCategoryWithAnchorFieldTest.xml | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml index 6886775bff57c..d12ce3d8fdbc0 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithAnchorFieldTest.xml @@ -29,15 +29,18 @@ <deleteData stepKey="deleteSimpleProduct" createDataKey="simpleProduct"/> </after> <!--Create SubCategory--> - <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/> - <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButton"/> - <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{_defaultCategory.name}}" stepKey="fillCategoryName"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="openAdminCategoryIndexPage"/> + <actionGroup ref="GoToCreateCategoryPageActionGroup" stepKey="clickOnAddSubCategoryButton"/> + <actionGroup ref="AdminChangeCategoryNameActionGroup" stepKey="fillCategoryName"/> <checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableCategory"/> <!--Select Content and fill the options--> - <scrollTo selector="{{AdminCategoryContentSection.sectionHeader}}" x="0" y="-80" stepKey="scrollToContent"/> - <click selector="{{AdminCategoryContentSection.sectionHeader}}" stepKey="selectContent"/> - <scrollTo selector="{{AdminCategoryContentSection.AddCMSBlock}}" x="0" y="-80" stepKey="scrollToAddCMSBlock"/> - <selectOption selector="{{AdminCategoryContentSection.AddCMSBlock}}" userInput="$$createDefaultCMSBlock.title$$" stepKey="selectCMSBlock"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToContent"/> + <actionGroup ref="AdminCategoriesOpenContentSectionActionGroup" stepKey="selectContent"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToAddCMSBlock"/> + <actionGroup ref="AdminCategoriesSetStaticBlockActionGroup" stepKey="selectCMSBlock"> + <argument name="block" value="$$createDefaultCMSBlock$$"/> + </actionGroup> + <!--Select Display Setting and fill the options--> <scrollTo selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" x="0" y="-80" stepKey="scrollToDisplaySetting"/> <click selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" stepKey="selectDisplaySetting"/> @@ -52,16 +55,20 @@ <click selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceCheckBox}}" stepKey="enableLayeredNavigationPrice"/> <fillField selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceInput}}" userInput="5.5" stepKey="fillThePrice"/> <!--Search the products and select the category products--> - <scrollTo selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" x="0" y="-80" stepKey="scrollToProductInCategory"/> - <click selector="{{AdminCategoryBasicFieldSection.productsInCategory}}" stepKey="clickOnProductInCategory"/> - <fillField selector="{{AdminCategoryContentSection.productTableColumnName}}" userInput="$$simpleProduct.name$$" stepKey="selectProduct"/> - <click selector="{{AdminCategoryContentSection.productSearch}}" stepKey="clickSearchButton"/> - <click selector="{{AdminCategoryContentSection.productTableRow}}" stepKey="selectProductFromTableRow"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToProductInCategory"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickOnProductInCategory"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectProduct"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickSearchButton"/> + <actionGroup ref="AdminAddProductToCategoryActionGroup" stepKey="selectProductFromTableRow"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="clickSaveButton"/> <actionGroup ref="AssertAdminCategorySaveSuccessMessageActionGroup" stepKey="assertSuccessMessage"/> <waitForPageLoad stepKey="waitForPageTitleToBeSaved"/> <!--Verify the Category Title--> - <see selector="{{AdminCategoryContentSection.categoryPageTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seePageTitle" /> + <actionGroup ref="AssertAdminCategoryPageTitleActionGroup" stepKey="seePageTitle"> + <argument name="categoryName" value="{{_defaultCategory.name}}"/> + </actionGroup> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#"/> <!-- Assert Redirect path, Target Path and Redirect type in grid --> <actionGroup ref="AdminSearchByRequestPathActionGroup" stepKey="searchByRequestPath"> @@ -73,10 +80,12 @@ <comment userInput="Adding the comment to replace CliIndexerReindexActionGroup action group ('indexer:reindex' commands) for preserving Backward Compatibility" stepKey="reindex"/> <comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/> <!--Verify Product in store front page--> - <amOnPage url="{{StorefrontCategoryPage.url(_defaultCategory.urlKey)}}" stepKey="amOnCategoryPage"/> - <waitForPageLoad stepKey="waitForPageToBeLoaded"/> - <see selector="{{StorefrontCategoryMainSection.CategoryTitle}}" userInput="{{_defaultCategory.name}}" stepKey="seeCategoryPageTitle"/> - <seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeCategoryOnNavigation"/> + <actionGroup ref="CheckCategoryOnStorefrontActionGroup" stepKey="amOnCategoryPage"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageToBeLoaded"/> + <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="seeCategoryPageTitle"/> + <actionGroup ref="StorefrontAssertCategoryNameIsShownInMenuActionGroup" stepKey="seeCategoryOnNavigation"> + <argument name="categoryName" value="{{_defaultCategory.name}}"/> + </actionGroup> <waitForPageLoad stepKey="waitForProductToLoad"/> <seeElement selector="{{StorefrontCategoryMainSection.productLinkByHref($$simpleProduct.custom_attributes[url_key]$$)}}" stepKey="seeProductInCategory"/> </test> From 13b6cbd695fee668619ccca4a636141b65bf7f23 Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Mon, 3 Jan 2022 12:45:32 +0200 Subject: [PATCH 28/35] replace action to action group --- .../AdminGridFilterRemoveErrorMessageBeforeApplyFiltersTest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFiltersTest.xml b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFiltersTest.xml index c7236c33e7cc0..f21c1d8926aac 100644 --- a/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFiltersTest.xml +++ b/app/code/Magento/Ui/Test/Mftf/Test/AdminGridFilterRemoveErrorMessageBeforeApplyFiltersTest.xml @@ -85,7 +85,7 @@ <fillField selector="{{AdminProductGridFilterSection.nameFilter}}" userInput="$$createProduct.name$$" stepKey="fillProductNameInNameFilter"/> <click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFiltersButton"/> <see selector="{{AdminProductGridFilterSection.nthRow('1')}}" userInput="$$createProduct.name$$" stepKey="seeFirstRowToVerifyProductVisibleInGrid"/> - <dontSeeElement selector="{{AdminMessagesSection.error}}" stepKey="dontSeeErrorMessage"/> + <actionGroup ref="AdminAssertNoErrorMessageActionGroup" stepKey="dontSeeErrorMessage"/> </test> </tests> From 7f9452b4d5700af3d5c055994422a73bf5fad7d7 Mon Sep 17 00:00:00 2001 From: engcom-Charlie <engcom-vendorworker-charlie@adobe.com> Date: Wed, 5 Jan 2022 11:23:18 +0530 Subject: [PATCH 29/35] Issue-34432 Fixed the failing functional test --- .../Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml index d9aee90c8c286..ce2cba291226a 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml @@ -60,12 +60,12 @@ <actionGroup ref="AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup" stepKey="clickAddSelectedBundleProducts"/> <grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantity"/> <assertEquals stepKey="assertFirstBundleOptionDefaultQuantity"> - <expectedResult type="string">50</expectedResult> + <expectedResult type="string">1</expectedResult> <actualResult type="string">$grabbedFirstBundleOptionQuantity</actualResult> </assertEquals> <grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" stepKey="grabbedSecondBundleOptionQuantity"/> <assertEquals stepKey="assertSecondBundleOptionDefaultQuantity"> - <expectedResult type="string">50</expectedResult> + <expectedResult type="string">1</expectedResult> <actualResult type="string">$grabbedSecondBundleOptionQuantity</actualResult> </assertEquals> <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> @@ -130,12 +130,12 @@ <actionGroup ref="AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup" stepKey="clickAddNewSelectedBundleProducts"/> <grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantityAfterUserInput"/> <assertEquals stepKey="assertFirstBundleOptionDefaultQuantityAfterUserInput"> - <expectedResult type="string">50</expectedResult> + <expectedResult type="string">{{BundleProduct.defaultQuantity}}</expectedResult> <actualResult type="string">$grabbedFirstBundleOptionQuantityAfterUserInput</actualResult> </assertEquals> <grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" stepKey="grabbedSecondBundleOptionQuantityAfterUserInput"/> <assertEquals stepKey="assertSecondBundleOptionDefaultQuantityAfterUserInput"> - <expectedResult type="string">50</expectedResult> + <expectedResult type="string">{{BundleProduct.defaultQuantity}}</expectedResult> <actualResult type="string">$grabbedSecondBundleOptionQuantityAfterUserInput</actualResult> </assertEquals> <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillNewProductDefaultQty1"> From c9e17ed1591ed098becf296850c1429011302669 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 11 Jan 2022 14:50:03 +0200 Subject: [PATCH 30/35] Merge 2.4-develop --- .../Test/AdminMassDeleteBundleProductsTest.xml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml index 68fee93091d16..5c23360e74d78 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml @@ -103,24 +103,8 @@ <argument name="optionTitle" value="{{BundleProduct.optionTitle1}}"/> <argument name="inputType" value="{{BundleProduct.optionInputType1}}"/> </actionGroup> -<<<<<<< HEAD - <checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow22"/> - <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts2"/> - <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty12"> - <argument name="optionIndex" value="0"/> - <argument name="productIndex" value="0"/> - <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> - </actionGroup> - - <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty22"> - <argument name="optionIndex" value="0"/> - <argument name="productIndex" value="1"/> - <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> - </actionGroup> -======= <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductDefaultQty12"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductDefaultQty22"/> ->>>>>>> 2.4-develop <actionGroup ref="AdminFillProductNameOnProductFormActionGroup" stepKey="fillProductName2"> <argument name="productName" value="{{BundleProduct.name2}}"/> From 3734856205acc8c80600cd67af736e35a9672b8e Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 11 Jan 2022 16:24:48 +0200 Subject: [PATCH 31/35] Merge 2.4-develop --- .../AdminMassDeleteBundleProductsTest.xml | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml index c5b969384829f..5c23360e74d78 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml @@ -85,25 +85,6 @@ <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad2"/> <!--Create bundle product 2--> -<<<<<<< HEAD - <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems2"/> - <click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption32"/> - <waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions2"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle2"/> - <selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType2"/> - <actionGroup ref="AdminClickAddProductToOptionActionGroup" stepKey="clickAddProductsToOption2"/> - <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptionsx2"> - <argument name="product" value="$$simpleProduct3$$"/> - </actionGroup> - <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRowx2"/> - <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions22"> - <argument name="product" value="$$simpleProduct4$$"/> - </actionGroup> - <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow22"/> - <click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts2"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty12"/> - <fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty22"/> -======= <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="conditionallyOpenSectionBundleItems2"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="clickAddOption32"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleOptions2"/> @@ -124,7 +105,6 @@ </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductDefaultQty12"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductDefaultQty22"/> ->>>>>>> 2.4-develop <actionGroup ref="AdminFillProductNameOnProductFormActionGroup" stepKey="fillProductName2"> <argument name="productName" value="{{BundleProduct.name2}}"/> From 4aa8195ebfb48f90172a60e5a81803f83e7723e3 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 11 Jan 2022 16:28:30 +0200 Subject: [PATCH 32/35] Merge 2.4-develop --- .../Mftf/Test/AdminAddBundleItemsTest.xml | 81 ------------------- 1 file changed, 81 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml index ab21c717fc423..bf8ac0cf3de88 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddBundleItemsTest.xml @@ -77,24 +77,11 @@ <expectedResult type="string">50</expectedResult> <actualResult type="string">$grabbedSecondBundleOptionQuantity</actualResult> </assertEquals> -<<<<<<< HEAD - <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty1"> - <argument name="optionIndex" value="0"/> - <argument name="productIndex" value="0"/> - <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> - </actionGroup> - <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProductDefaultQty2"> - <argument name="optionIndex" value="0"/> - <argument name="productIndex" value="1"/> - <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> - </actionGroup> -======= <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductDefaultQty1"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductDefaultQty2"/> <!--Fill out ancillary data on bundle product--> ->>>>>>> 2.4-develop <actionGroup ref="AncillaryPrepBundleProductActionGroup" stepKey="createBundledProductForTwoSimpleProducts"> <argument name="bundleProduct" value="BundleProduct"/> </actionGroup> @@ -105,17 +92,6 @@ <scrollToTopOfPage stepKey="scroll"/> <conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems2"/> -<<<<<<< HEAD - <seeElement stepKey="LookingForBundleItemPresence" selector="{{AdminProductFormBundleSection.listedBundleItem}}"/> - <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="GoToProductPage"> - <argument name="productUrlKey" value="{{BundleProduct.urlKey}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductPageToLoad"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="LookingForAbilityToAddOptions"/> - - <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickButtonToCustomize"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitCustomizationDropDown"/> -======= <seeElement selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="LookingForBundleItemPresence"/> <!--Checking on customer side--> @@ -126,44 +102,14 @@ <seeElement selector="{{StorefrontBundledSection.customizeProduct}}" stepKey="LookingForAbilityToAddOptions"/> <click selector="{{StorefrontBundledSection.customizeProduct}}" stepKey="clickButtonToCustomize"/> <waitForPageLoad stepKey="waitCustomizationDropDown"/> ->>>>>>> 2.4-develop <seeElement selector="{{StorefrontBundledSection.customizableBundleItemOption}}" stepKey="seeBundleItem"/> <actionGroup ref="AdminOpenCatalogProductPageActionGroup" stepKey="goToCatalogProductPage"/> -<<<<<<< HEAD - <actionGroup ref="AdminClearFiltersActionGroup" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/> -======= <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="ClickOnButtonToRemoveFiltersIfPresent"/> ->>>>>>> 2.4-develop <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="WaitForClear"/> <actionGroup ref="FilterProductGridByNameActionGroup" stepKey="filterBundleProductOptionsDownToName"> <argument name="product" value="BundleProduct"/> </actionGroup> -<<<<<<< HEAD - <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="clickOnBundleProductToEdit"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="conditionallyOpenSectionBundleItemsToEdit"/> - <actionGroup ref="AdminClickAddOptionOnBundleProductEditPageActionGroup" stepKey="clickAddOption"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleOptionsToAppear"/> - <actionGroup ref="AdminFillBundleOptionTitleActionGroup" stepKey="fillNewestOptionTitle"> - <argument name="optionTitle" value="{{BundleProduct.optionTitle1}}_new"/> - <argument name="index" value="1"/> - </actionGroup> - <actionGroup ref="AdminFillBundleOptionTypeActionGroup" stepKey="selectNewInputType"> - <argument name="optionIndex" value="1"/> - </actionGroup> - <actionGroup ref="AdminClickAddProductToOptionByOptionIndexActionGroup" stepKey="clickAddProductsToNewOption"> - <argument name="optionIndex" value="2"/> - </actionGroup> - <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterNewBundleProductOptions"> - <argument name="product" value="$$simpleProduct2$$"/> - </actionGroup> - <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectNewFirstGridRow"/> - <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterNewBundleProductOptions2"> - <argument name="product" value="$$simpleProduct3$$"/> - </actionGroup> - <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectNewFirstGridRow2"/> - <actionGroup ref="AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup" stepKey="clickAddNewSelectedBundleProducts"/> -======= <actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickOnBundleProductToEdit"> <argument name="product" value="BundleProduct"/> </actionGroup> @@ -187,7 +133,6 @@ </actionGroup> <!-- Check that existing Bundle Options do not loose user input quantity values --> ->>>>>>> 2.4-develop <grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantityAfterUserInput"/> <assertEquals stepKey="assertFirstBundleOptionDefaultQuantityAfterUserInput"> <expectedResult type="string">50</expectedResult> @@ -198,31 +143,6 @@ <expectedResult type="string">50</expectedResult> <actualResult type="string">$grabbedSecondBundleOptionQuantityAfterUserInput</actualResult> </assertEquals> -<<<<<<< HEAD - <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillNewProductDefaultQty1"> - <argument name="optionIndex" value="1"/> - <argument name="productIndex" value="0"/> - <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> - </actionGroup> - <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillNewProductDefaultQty2"> - <argument name="optionIndex" value="1"/> - <argument name="productIndex" value="1"/> - <argument name="qty" value="{{BundleProduct.defaultQuantity}}"/> - </actionGroup> - <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickSaveButtonAgain"/> - <see userInput="You saved the product." stepKey="messageYouSavedTheProductIsShownAgain"/> - <scrollToTopOfPage stepKey="scrollAgain"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="conditionallyOpenNewSectionBundleItems2"/> - <see userInput="$$simpleProduct2.sku$$" selector="{{AdminProductFormBundleSection.bundleItem}}" stepKey="LookingForNewBundleItemPresence"/> - - <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="GoToProductPageAgain"> - <argument name="productUrlKey" value="{{BundleProduct.urlKey}}"/> - </actionGroup> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductPageToLoadAgain"/> - <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="LookingForAbilityToAddBothOptions"/> - <actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickButtonAgainToCustomize"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBothCustomizationDropDown"/> -======= <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillNewProductDefaultQty1"/> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillNewProductDefaultQty2"/> <!--Save the product--> @@ -244,7 +164,6 @@ <seeElement selector="{{StorefrontBundledSection.customizeProduct}}" stepKey="LookingForAbilityToAddBothOptions"/> <click selector="{{StorefrontBundledSection.customizeProduct}}" stepKey="clickButtonAgainToCustomize"/> <waitForPageLoad stepKey="waitForBothCustomizationDropDown"/> ->>>>>>> 2.4-develop <seeElement selector="{{StorefrontBundledSection.customizableBundleItemOption2}}" stepKey="seeBundleItems"/> </test> </tests> From 8947c7b73c3af2cd2018e6711c38aba0b8af91b2 Mon Sep 17 00:00:00 2001 From: Anna Pak <a.pak@atwix.com> Date: Tue, 11 Jan 2022 16:34:32 +0200 Subject: [PATCH 33/35] Merge 2.4-develop --- .../Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml | 5 ----- .../Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml | 4 ---- 2 files changed, 9 deletions(-) diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml index efdd6f1fca467..5c23360e74d78 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminMassDeleteBundleProductsTest.xml @@ -78,16 +78,11 @@ <!--Creating Second bundle product--> <!--Go to bundle product creation page--> -<<<<<<< HEAD - <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage2"/> - <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreationPage2"/> -======= <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="goToBundleProductCreationPage2"> <argument name="attributeSetId" value="{{BundleProduct.set}}"/> <argument name="productType" value="{{BundleProduct.type}}"/> </actionGroup> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad2"/> ->>>>>>> 2.4-develop <!--Create bundle product 2--> <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="conditionallyOpenSectionBundleItems2"/> diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml index 556bd56cf51b1..5758a782d3b55 100644 --- a/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml +++ b/app/code/Magento/Bundle/Test/Mftf/Test/EnableDisableBundleProductStatusTest.xml @@ -35,14 +35,10 @@ <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <!--Go to bundle product creation page--> -<<<<<<< HEAD - <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> -======= <actionGroup ref="AdminOpenNewProductFormPageActionGroup" stepKey="goToBundleProductCreationPage"> <argument name="attributeSetId" value="{{BundleProduct.set}}"/> <argument name="productType" value="{{BundleProduct.type}}"/> </actionGroup> ->>>>>>> 2.4-develop <comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForBundleProductCreatePageToLoad"/> <!-- Add two bundle items --> From 64cae2fef7d32c34ba97969b401c3f337d5c1c65 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov <sidolov@magento.com> Date: Tue, 1 Feb 2022 15:54:10 -0600 Subject: [PATCH 34/35] magento-engcom/magento2ce#4283: Fixed test --- .../ActionGroup/AdminFilterCustomerGridByEmailActionGroup.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFilterCustomerGridByEmailActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFilterCustomerGridByEmailActionGroup.xml index 90492a9588fc8..6e54acc6c3f16 100644 --- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFilterCustomerGridByEmailActionGroup.xml +++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFilterCustomerGridByEmailActionGroup.xml @@ -17,9 +17,11 @@ <argument name="email" type="string"/> </arguments> - <conditionalClick selector="{{AdminCustomerFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerFiltersSection.clearAll}}" visible="true" stepKey="clickClearFilters"/> <click selector="{{AdminCustomerFiltersSection.filtersButton}}" stepKey="openFilters"/> + <conditionalClick selector="{{AdminCustomerFiltersSection.clearAll}}" dependentSelector="{{AdminCustomerFiltersSection.clearAll}}" visible="true" stepKey="clickClearFilters"/> + <waitForPageLoad stepKey="waitForClearFilters"/> <fillField selector="{{AdminCustomerFiltersSection.emailInput}}" userInput="{{email}}" stepKey="fillEmail"/> <click selector="{{AdminCustomerFiltersSection.apply}}" stepKey="clickApplyFilters"/> + <waitForPageLoad stepKey="waitForPageToLoad"/> </actionGroup> </actionGroups> From 261b055a575809083f08953469b9cb26e9d309b8 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov <sidolov@magento.com> Date: Wed, 2 Feb 2022 15:06:56 -0600 Subject: [PATCH 35/35] magento-engcom/magento2ce#4283: Fixed test --- .../Store/Test/Mftf/Test/StorefrontAddStoreCodeInUrlTest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/code/Magento/Store/Test/Mftf/Test/StorefrontAddStoreCodeInUrlTest.xml b/app/code/Magento/Store/Test/Mftf/Test/StorefrontAddStoreCodeInUrlTest.xml index d87f6ec926c8f..26bf18350de90 100644 --- a/app/code/Magento/Store/Test/Mftf/Test/StorefrontAddStoreCodeInUrlTest.xml +++ b/app/code/Magento/Store/Test/Mftf/Test/StorefrontAddStoreCodeInUrlTest.xml @@ -28,6 +28,9 @@ </before> <after> <magentoCLI command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="addStoreCodeToUrlDisable"/> + <actionGroup ref="CliCacheFlushActionGroup" stepKey="flushPageCacheAfter"> + <argument name="tags" value="full_page"/> + </actionGroup> </after> <actionGroup ref="StorefrontClickOnHeaderLogoActionGroup" stepKey="clickOnStorefrontHeaderLogo"/>